【问题标题】:navigator.geolocation.getcurrentposition is not working in safarinavigator.geolocation.getcurrentposition 在 safari 中不起作用
【发布时间】:2014-10-07 08:45:01
【问题描述】:

这是我用于获取位置的代码。但不幸的是,它总是打印“失败回调”。

 var location_timeout = setTimeout(function(){alert('failed');}, 10000);
        navigator.geolocation.getCurrentPosition(function(position) {
            findInStore.isGeoLocationPos = position;
            clearTimeout(location_timeout);
            alert('Succ call back')
            findInStore.onDirectionLocation(event);
        },function(){clearTimeout(location_timeout);
        alert('failure call back');}); 

试试

 http://stackoverflow.com/questions/7350033/geolocation-not-working-in-safari
 http://stackoverflow.com/questions/3397585/navigator-geolocation-getcurrentposition-sometimes-works-sometimes-doesnt

还有更多。但没有任何帮助。 getCurrentPosition 调用失败。有什么建议么?我不擅长这个。

【问题讨论】:

    标签: javascript safari geolocation


    【解决方案1】:

    在您的计算机上打开 Wifi,它就会工作。 Safari 使用 wifi 对您的计算机进行地理定位 :-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-13
      • 1970-01-01
      • 2017-03-08
      • 1970-01-01
      • 2018-11-14
      • 2013-06-25
      • 2018-04-30
      • 2012-03-02
      相关资源
      最近更新 更多