New Maps Component Example

956 views
Skip to first unread message

SteveJG

unread,
Dec 30, 2017, 6:58:13 PM12/30/17
to mitappinv...@googlegroups.com
Evan's blog shows some of what is possible with the new Maps component  http://appinventor.mit.edu/explore/blogs/evan/2017/09.html 

This example is a simple application using the new Maps component.




1)  The example must be tested using Companion on a device.  The code will not run in the emulator because GPS hardware is required and the emulator has none.
2)  The example uses the Maps' built-in location sensor; the user's location updates once every 60 seconds.  The interval is not user changeable.  If you need a different refresh, use the existing LocationSensor component in conjunction with Maps.  This examples does not show how to do that.   Experiment..
3)  The device GPS must be turned on in Settings; the GPS settings must allow the use of a GPS receiver in your device.
4)  The app requires about 20 seconds to initially aquire a satellite fix.  Press the Show My Location button and a map will either display or a notification will show indicating a satellite fix was not yet acquired.  Try again in a few seconds.
5)  Maps requires either a WIFI or a network connection.  It needs the maps at OpenStreetMaps to work.
6)  The Maps component is complex; the example uses only a few features.
7)  If your device is a phone and goes to sleep, the map may not update unless you provide a Stay Awake capability.  Google the Forum for Stay Awake options and the consequential issues of rapid battery depletion.
8)  This app does NOT work in the background.

I encourage developers to try the code using the images before reverting to the aia file and to consult the Maps reference at 
If you are not familiar with GPS, you may want to also read the Location Sensor tutorial  
Most of what is there also applies to the 'build-in' location sensor capabilities of Maps.

Edit:  you might also be interested in this thread that discusses placing Markers in maps:   https://groups.google.com/forum/#!category-topic/mitappinventortest/LlYPkhP1Bw4

Regards,
Steve
MapsSimple.aia

Abraham Getzler

unread,
Dec 31, 2017, 2:41:43 PM12/31/17
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages