阅读背景:

如何在getcurrentposition有数据之前停止app加载?

来源:互联网 

I have some code that detects the location and returns the longitude and latitude. It stores these values in a variable and then adds these to a URL which is then used to open a webview. The problem I'm having is that it takes the app a few milleseconds before it has the location date, and then when the app loads the webview the coordinates come out as "undefined" as the location data hasn't been received. If I create an alert and echo the URL with the coordiantes, and then set a timeout (1 millesecond works) then the alert will print the correct information. I have some code that detects the location and




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: