1

I am running leaflet.js project on my android app using a webview. Everything is great but for current user location leaflet uses GPS because it runs in a webview and as we know webview is extention of browser on android. Now GPS is not very reliable. I want to access android sensors of accelerometer or geomagnetic sensor to determine user position not GPS. Is there a way to achieve this?

  • "for current user location leaflet uses GPS because it runs in a webview and as we know webview is extention of browser on android". The underlying Android operating system is feeding that webview if you are using the HTML5 API for location... are you seeing something different? – Ragi Yaser Burhum Nov 20 '17 at 2:20
  • I am using the geolocation api leaflet provides. I am recovering user location using map.locate(). Don't know if leaflet uses HTML 5 api in underlying architecture or not. But when I use my map in webview,the location does turn on and starts tracking but I don't see the location setting in android turned on. Neither I get any sort of warning that you usually get when trying to run an app that requires location service. – enemy123 Nov 20 '17 at 3:35
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.