how to get current location in phonegap?

后端 未结 2 1733
走了就别回头了
走了就别回头了 2021-01-14 09:10

i added Geolocation plugin in my app and used this code for getting the current location in phonegap. but this code does not work.

    document.addEventList         


        
2条回答
  •  时光说笑
    2021-01-14 09:22

    1. check if geolocation is properly installed or not

    2. restart your phone (silly solution but it works sometimes.I faced it once)

    3. check if your geo permissions & settings are turned on in device

    4. test with this code

      options = { enableHighAccuracy: true }; navigator.geolocation.getCurrentPosition(onSuccess, onError, options);

    5. If you're using android, try to get the error with eclipse logcat.

提交回复
热议问题