I have a problem where I need a map to follow the GPS, so I do the regular:
dataSource.setLocationMarker(marker);
map.setLocationSource(dataSource);
But, I also need panning and zooming. Zoom is not a problem, but when panning, each three seconds the map update and goes back with the marker in the center.
I need to stop the tracking while the user is panning, and re enabled it with a menu option. Problem is, the only way I found out was to remove the datasource. That stops the tracking, but I cannot re enable tracking, since adding back the datasource has no effect.
Is there a way to stop the GPS tracking and re enable it?
Thanks.
William Martinez
LocationMarker has method setTrackingEnabled(boolean) for this.
So make sure that marker is a field (not local variable) and then you can do:
public void mapMoved() {
marker.setTrackingEnabled(false);
}
And in your menu handler you set it to "true" again
/JaakL