When i start checking geolocation with navigator.geolocation.watchPosition() (cordova-plugin-geolocation is installed), and want to stop it, clearWatch() stops delivering geolocation information but the GPS symbol in the phone’s statusbar doesn’t disappear.
After closing the app, GPS symbol disappears.
Correct behaviour?
What about battery lifetime?
Is it just the symbol in the status bar or is GPS still activated and delivers new choords?
weird. If you’re not using crosswalk. (just compiling with cordova) then the gps behavior is determined and executed by the native browser of your mobile device.
More info about the device you’re running this would be helpful. also, did you try this on a different device just to see if you get the same behavior?
clearWatch should remove GPS signal icon from status bar if something else is not actively using it. I had similar problems but can’t remember exactly. I think the thing was that several new watch position ID’s where created in some cases when you pause app (exit from app but not kill it) and start it again.
You probably have the same problem, check if you have several watch positon ids.
Just worked on this old issue today and fixed it.
It was my fault, my openlayers module created his own geolocation listener. So i had two of them but only killed one with clearWatch(). clearWatch() works as expected.