From fda6634c6f5ec6d9b8197f235e7fc44032996093 Mon Sep 17 00:00:00 2001 From: michigg Date: Sat, 14 Oct 2017 01:46:47 +0200 Subject: [PATCH] locate with high accuracy --- ofu_app/static/js/donar/navigate.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ofu_app/static/js/donar/navigate.js b/ofu_app/static/js/donar/navigate.js index 93f2630..64cf437 100644 --- a/ofu_app/static/js/donar/navigate.js +++ b/ofu_app/static/js/donar/navigate.js @@ -55,8 +55,14 @@ function resizeMap() { document.getElementById('map').style.height = height + 'px' } +/** + * save current position in global vars + */ function getPos() { if (navigator.geolocation) { + var geo_option = { + enableHighAccuracy: true, + } navigator.geolocation.getCurrentPosition(function (position) { console.log(position); startLat = position.coords.latitude; @@ -64,7 +70,7 @@ function getPos() { }, function (err) { console.log(err.code) console.log(err.message) - }) + }, geo_option) } else { document.getElementById('map').innerHTML('Geolocation not available') }