diff --git a/packages/plugins/GeoLocation/CHANGELOG.md b/packages/plugins/GeoLocation/CHANGELOG.md index 7180b6fb3..fd8df329b 100644 --- a/packages/plugins/GeoLocation/CHANGELOG.md +++ b/packages/plugins/GeoLocation/CHANGELOG.md @@ -3,6 +3,7 @@ ## unpublished - Fix: Only zoom to the user position if the user is currently in the extent of the map. The user position is no longer indicated when it's outside the map's extent. +- Fix: The plugin would fail the map initialization procedure on Safari 15 and prior. This issue has been resolved by disabling the fail-fast feature for browsers not supporting `navigator.permissions.query`. ## 1.3.0 diff --git a/packages/plugins/GeoLocation/src/store/actions.ts b/packages/plugins/GeoLocation/src/store/actions.ts index d58648fd7..b3ecb7ac4 100644 --- a/packages/plugins/GeoLocation/src/store/actions.ts +++ b/packages/plugins/GeoLocation/src/store/actions.ts @@ -18,12 +18,14 @@ const actions: PolarActionTree = { setupModule({ getters, commit, dispatch }): void { dispatch('addMarkerLayer') - // NOTE: limited support across browsers - navigator.permissions.query({ name: 'geolocation' }).then((result) => { - if (result.state === 'denied') { - commit('setIsGeolocationDenied', true) - } - }) + // NOTE: limited support across browsers; nice but optional initially + if (navigator.permissions?.query) { + navigator.permissions.query({ name: 'geolocation' }).then((result) => { + if (result.state === 'denied') { + commit('setIsGeolocationDenied', true) + } + }) + } if (getters.checkLocationInitially) { dispatch('track') }