Created
January 16, 2020 14:33
-
-
Save grandmanitou/1473b8abec32bbb7c0c54f48d595ef83 to your computer and use it in GitHub Desktop.
Locate user with mapbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let geoTracker = new mapboxgl.GeolocateControl({ | |
positionOptions: { | |
enableHighAccuracy: true | |
}, | |
trackUserLocation: false, | |
showUserLocation: true, | |
}); | |
geoTracker.on('geolocate', function (e) { | |
getGeoJson(e.coords.longitude, e.coords.latitude, 5); | |
}); | |
map.addControl(geoTracker); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment