Skip to content

Commit 4fe67bc

Browse files
xssfoxTheSkorm
authored andcommitted
use device gps if possible for setting location
1 parent 8ef4286 commit 4fe67bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/sondehub.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,13 @@ function load() {
868868
zoomLevel = 5;
869869
}
870870

871+
// load location from browser position if possible
872+
if (currentPosition){
873+
console.log(currentPosition)
874+
coords = [currentPosition.lat, currentPosition.lon]
875+
zoomLevel = 9;
876+
}
877+
871878
//initialize map object
872879
map = new L.map(document.getElementById('map'), {
873880
zoom: zoomLevel,

0 commit comments

Comments
 (0)