@globalfishingwatch/react-map-gl
Version:
A React wrapper for MapboxGL-js and overlay API.
19 lines (17 loc) • 492 B
JavaScript
let supported;
export function isGeolocationSupported() {
if (supported !== undefined) {
return Promise.resolve(supported);
}
if (window.navigator.permissions !== undefined) {
return window.navigator.permissions.query({
name: 'geolocation'
}).then(p => {
supported = p.state !== 'denied';
return supported;
});
}
supported = Boolean(window.navigator.geolocation);
return Promise.resolve(supported);
}
//# sourceMappingURL=geolocate-utils.js.map