navigator.geolocation.getCurrentPosition doesn't work on android google chrome

后端 未结 7 1868
醉酒成梦
醉酒成梦 2021-01-01 10:55

This code:

navigator.geolocation.getCurrentPosition(
                    function(position) {
                        alert(position.coords.latitude, positio         


        
7条回答
  •  走了就别回头了
    2021-01-01 11:15

    Just finished testing a bunch of mobile devices and the Javascript Geolocation. I used the example code from Google in order to make sure that the problem is not in my own code.

    Chrome for Android 4.4 does not seem to work with GPS-only location services and neither does the 2.3 stock browser. They both need "High accuracy" - the use of wireless and 3G/4G networks.

    The funny thing is that Firefox for Android works without any problems GPS-only. Only the stock Android browsers (Chrome + Mobile Safari) fail with GPS-only location settings.

    And the rest of the gang - Lumia WP8 with GPS, Windows and Linux (both with ADSL) worked perfectly with any location settings.

提交回复
热议问题