Question about the newMapView

Hello,

I am learning how to use the mapView and when I add the following lines of code it displays the mape of where I am and puts a blue round marker of my location. So I assume this is automatic when I create a new MapView?

My other question is what do I call to refresh the map? If I am driving and want to refresh the map displayed when do I call?

Thanks!

myMap = native.newMapView( 1, 0, 319, 400 ) myMap.mapType = "standard"

Does calling the getUserLocation retrieve the new lat/long for where the phone is with it’s gps? I need to refresh the map of where I am after it is displayed.

Thanks

Warren

For your first question, you would need to get the Lat, Long from the GPS using GPS events and feed that to your map’s object’s setCenter() method.

http://docs.coronalabs.com/api/type/Map/setCenter.html

getUserLocation() would seem to do the same thing but you would need to then call setCenter to redraw the map.

Does calling the getUserLocation retrieve the new lat/long for where the phone is with it’s gps? I need to refresh the map of where I am after it is displayed.

Thanks

Warren

For your first question, you would need to get the Lat, Long from the GPS using GPS events and feed that to your map’s object’s setCenter() method.

http://docs.coronalabs.com/api/type/Map/setCenter.html

getUserLocation() would seem to do the same thing but you would need to then call setCenter to redraw the map.