lwf
April 9, 2015, 5:58am
1
I want to get the position of my device, so I try the Geolocation from both ngCordova and Cordova. But I get ‘timeout’ everytime. I can’t visit google in china, and I think it is the problem.
By the way , I want the latitude and longitude with high accuracy.
Anyone would give me a hand。。?
Can you give some more details? What device(s) are you using? Cordova version?
If you’re able to view Stack Overflow here are some posts on this, if not let me know and I’ll paste the relevant text.
I fix this issue by used baidu map.
the second post works for me.
If anyone else want’s to know how to make this work, just wrap your geolocation code into device ready event.
More about this topic can be found in another forum question:
Several things changed since last time this post was active.
I. First of all, geolocation works with Ionic (it was never under question). Cordova.js file was also never a problem. If you want to get a correct location just wrap you code into device ready event.
II.Use ngCordova Geolocation plugin
III.If you’re using Cordova 4.0 + version make sure to install Cordova Whitelist plugin, Google Maps will not work with it.
IV. Whitelist plugin comes with new HTML5 meta tag, you MUST include it if…