AnsweredAssumed Answered

Android 100 API: stop Location Display

Question asked by lageplan on Mar 5, 2018
Latest reply on Mar 9, 2018 by lageplan

Hi,

 

I'm using

mapView.getLocationDisplay().setShowLocation(true);
mapView.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.RECENTER);
mapView.getLocationDisplay().startAsync();

to start the location service in my  100.2.1 Android app, and
mapView.getLocationDisplay().stop();
mapView.getLocationDisplay().setShowLocation(false);
mapView.getLocationDisplay().setAutoPanMode(LocationDisplay.AutoPanMode.OFF)

to stop it. I stop the service every time I pause the app,
and restart it only if the user clicks on the GPS button on my map.

However, it sometimes happens that when I stop the Location Display, then immediately pause and resume the app,
the location marker is still shown on the map (although it is no longer animated or moving).

This wouldn't really bother me that much, but unfortunately, if I now click on a POI on my map,
the MapView only briefly zooms to that POI (as expected), and then instantly zooms back to the
location marker, even though the AutoPanMode is off and the LocationDisplay is not running!
(mapView.getLocationDisplay().isStarted() = false!).

The same happens occasionally if I do not pause the app, but simply switch basemaps.
I.e., I stop the Location Display (the location marker disappears), switch to a new basemap, and
(sometimes) see the location marker on the map again, and the map keeps zooming back to this location.

Is this a bug in the API? Or what might cause this issue?

Thank you,

Claudia





Outcomes