how do I prompt location share permission to user using JavaScript. For example whenever we visit google maps browser automatically asks for share location. My Aim is to prompt user for permission to share location. As I'm working in tracking module in AngularJS though i need to prompt user for permission in google Chrome. Thank you
You can use the function like this. Calling this function will raise the popup.
navigator.geolocation.getCurrentPosition(function(position) {
yourFunction(position.coords.latitude, position.coords.longitude);
});
When position is available, yourFunction will get executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With