How to set a timeout for finding location with geo.js?
I use geo.js in my webapp to let user share their location. In most browsers it works fine, however in Safari it usually hangs up. I know there's timeou开发者_Go百科t in HTML5 geolocation, is there such thing in geo.js too?
Thanks!
You should try it directly when calling the getCurrentPosition method, something like:
geo_position_js.getCurrentPosition(show_position, error_callback, {timeout: 10000});
精彩评论