Map position to user location when screen initalize

Is ther a way to position the map view port to the user location when screen initalize? I tryed “pan to user location” when screen initialize. And I tryed set center to string user lon/langitude.

You must wait that the gps can connect before

Ok, can I make a splah screen till the GPS signal is received…

1 Like

Or post a message telling that the gps must connect

Yeah, is there a bloch “when gps connected” or something like that?

There is a propierty that says something like hasLatitudeLongitude. It’s a boolean value.

You can do somethimg like…

if(gps.haslatitudlongitud){
pan(lat,lon)
}

if in doubt, just check the documentation…
http://ai2.appinventor.mit.edu/reference/components/sensors.html#LocationSensor

HasLongitudeLatitude
If true, Android device can report longitude and latitude.

Taifun

gps is enabled, if the property ProviderName of the location sensor contains the string gps, see also the example “Get Available SSIDs” here App Inventor Extensions: WiFi | Pura Vida Apps

Taifun