Stop location update after location found
See original GitHub issueI have the following issue:
I draw a marker and get the current location on load page. I drag/drop the marker to a desired location. I press the location control button to turn back to the current location.
Now I need to stop this control to update the location:
function onLocationFound(e) {
var radius = e.accuracy / 2;
$.get('https://nominatim.openstreetmap.org/reverse', {
format: "json",
addressdetails: 0,
lat: e.latlng.lat,
lon: e.latlng.lng
},
function (data) {
$("#address").val(data.display_name);
});
if(typeof (marker) != "undefined") {
marker.removeFrom(map);
circle.removeFrom(map);
}
marker = L.marker(e.latlng, {draggable: true});
marker.addTo(map)
.bindPopup("You are within " + radius + " meters from this point").openPopup();
marker.on('drag', onDrag);
circle = L.circle(e.latlng, radius);
circle.addTo(map);
map.setView(e.latlng, 16);
lc.stopFollowing(); // <----- I tried this but simply doesn't work.
}
How do I achieve it?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to stop location manager? - android - Stack Overflow
Is it possible your activity isn't being destroyed? i.e.: you hit the home button. Move your gps start/stop to onStart and onPause ....
Read more >Request location updates - Android Developers
Stop location updates Consider whether you want to stop the location updates when the activity is no longer in focus, such as...
Read more >Background Location Update stops r… - Apple Developer
Location monitoring has been constant and notification was triggered when the destination is within a certain distance. To do this, I've turned on:...
Read more >Android 101: How to stop location tracking - The Verge
Uncheck “Add location information to your Tweets.” Then click on “Delete all location information.” And if it asks: yes, you are sure. Update...
Read more >Manage your Android device's location settings
Swipe down from the top of the screen. · Touch and hold Location . If you don't find Location : Tap Edit or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue. Should be fixed in v0.65.2
Hmm, odd.