I have a leaflet map where I allow the user to turn on a mode where the map will follow and update their location every 30 seconds. This is implemented with a button click that corresponds to an ActiveLocation = true variable, and as long as it is set to true the map will check for location every 30 seconds and display a location pin and center the view to it. This is needed because the map is used while users are on the move.
Problem
Sometimes users want to check something on the map while ActiveLocation is enabled and they do that without disabling it. Because the map re-centers the view every 30 seconds their work is interrupted. because there is no way to differentiate between the user moving the map and the map moving due to the map.locate() function I have no way of knowing when the user intentionally initiated the change and pause the activeLocation until they request it back.
Are you aware of an efficient and clean way to achieve that? And is there any extension for leaflet that allows features similar to Google Maps' navigation?
Thanks!