Skip to content

Commit

Permalink
Adds warning to geolocate control when unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
Ændrew Rininsland authored Jul 6, 2018
1 parent 01f0857 commit 0376f42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/control/geolocate_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ class GeolocateControl extends Evented {
}

_setupUI(supported: boolean) {
if (supported === false) return;
if (supported === false) {
warnOnce('Geolocation not supported. The Mapbox geolocate control will not be rendered.');
return;
}
this._container.addEventListener('contextmenu', (e: MouseEvent) => e.preventDefault());
this._geolocateButton = DOM.create('button',
`${className}-icon ${className}-geolocate`,
Expand Down

0 comments on commit 0376f42

Please sign in to comment.