navigator.permissions.query({ name: 'geolocation' }).then((result) => {
 if (result.state === 'granted') {
   enableGeolocation();
   // 
 } if (result.state === 'prompt') {
   showButtonToEnablesGeolocation();
 } if (result.state === 'denied'){
   // fallback behaviour
 }
 // Don't do anything if the permission was denied.
});

getCurrentPosition(success, error, options)