apache/cordova-plugin-geolocation — pull request #25 by markwpearce (2014-09-15 19:47:31+00:00)
Title: iOS: Clearing all Watches stops Location Services

iOS shows a little arrow in the status bar if location services are in use. When you set a watch on Location Manager, it starts tracking position, and the arrow symbol appears. However, when that watch is cleared, no command to Location Manager is sent to stop tracking, so the arrow stays visible, even though in reality, the app is not using location services. My guess is that this also impacts battery life to some extent, especially if your iOS app has background location enabled.

This fix would automatically stop tracking location once all watched are cleared, so that the arrow symbol in the iOS status will disappear.

Tested on iOS 7.1.2.

(Note: I don't really want to go through the rigamarole of signing up to be a contributor, so if someone else wants to take credit for this, go ahead)