简体   繁体   中英

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 timeout in HTML5 geolocation, is there such thing in geo.js too?

Thanks!

您应在调用getCurrentPosition方法时直接尝试使用它,例如:

geo_position_js.getCurrentPosition(show_position, error_callback, {timeout: 10000});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM