Petr Poloprutský

unread,
Jan 30, 2015, 3:47:03 PM1/30/15
to
Hello,
I'm new here and am trying to create a small application.
This is a custom Google map that displays the application via the web Viever and would like to make the map work current GPS position. But I can not figure out how I'm programmed to web viewer married gps phone location. What conditions do I use? Thank you for your reply and thank you for your patience.

SteveJG

unread,
Jan 30, 2015, 4:45:20 PM1/30/15
to mitappinv...@googlegroups.com
Sorry Petr, you can not use the GPS to post a location to a CUSTOM Google map.  You can use a regular Google Map  or the Maps used in conjunction with  Google's Fusion Table. A Static Google Map can be used and you can watch the location changed as long as your GPS is updating and you also update the static map. 

MIT has several geolocation tutorials ... Where is My Car and the LocationSensor tutorials are here:  http://appinventor.mit.edu/explore/ai2/tutorials3818.html?&page=2

Do those links help?

Regards,  
Steve

Petr Poloprutský

unread,
Jan 30, 2015, 4:51:59 PM1/30/15
to mitappinv...@googlegroups.com
Thank you for your response, I thought it would go .. When this map https://www.google.com/maps/d/edit?mid=zCHLzeOgr-CE.k-QOAg6MicyI view your phone's browser and enable GPS shows me the location. That's why I thought it would work despite the Web Viewer.

SteveJG

unread,
Jan 30, 2015, 5:12:51 PM1/30/15
to mitappinv...@googlegroups.com
If you need to plot a location on a map with a 'pin' at the water hydrant, you can use a Google Static Map API to post the pins on the static map and you can also post your current location.  You won't get your location as the GPS moves around, however, if you refresh the request you would make using the ActivityStarter, you can update your current location.


Regards,
Steve

Petr Poloprutský

unread,
Jan 30, 2015, 5:53:02 PM1/30/15
to mitappinv...@googlegroups.com
So it's too complicated. Thank you very much for your help.

SteveJG

unread,
Jan 30, 2015, 5:55:38 PM1/30/15
to mitappinv...@googlegroups.com
Petr, this is NOT complicated.  Do you have the latitude and longitude of each of the hydrants?    This is not hard, it just takes a bit of coding.

SteveJG

unread,
Jan 30, 2015, 9:15:26 PM1/30/15
to mitappinv...@googlegroups.com
Here is a simple way to make your map on which your GPS location can plot, but with the Google Static Map API :




Values of latitude and longitude from the LocationSensor could replace the map center  coordinates (use a global theLatitude and theLongitude ) so the map will always be centered.   You would need a pin to show your current location, so I would also use the LocationSensor coordinates in the slot that ist is labeled as a blue S pin.       Note the orange pin is not labeled (it is preceded by a different script than the other pins). The link to the Google Static API explains what most of the strange characters are for.

Try it.  This is not difficult, you do however need to know the coordinates of your pins so they can be inputted.  This is simple; using lists and other tools, this could be made very flexible and editable.

Hope it works for you.

Regards,
Steve

Petr Poloprutský

unread,
Jan 30, 2015, 11:12:52 PM1/30/15
to
Thank you very much for the advice, I'll try:-)

Taifun

unread,
Feb 1, 2015, 2:17:28 PM2/1/15
to mitappinv...@googlegroups.com
meanwhile I played around a little bit with the Google Maps JavaScript API and this is the result https://puravidaapps.com/geolocation.php
Taifun

SteveJG

unread,
Feb 1, 2015, 2:30:32 PM2/1/15
to mitappinv...@googlegroups.com
@ Taifun .. very nice way of using a Custom Google Map in the WebViewer.

Example demonstrates there are MANY ways to have App Inventor 2 display maps and location information.  This is a new one.  Thanks for posting your solution.  

@ Petr .. now you have another possibility.  Good luck.

-- Steve
Reply all
Reply to author
Forward
0 new messages