2014-10-07 5 views
0

이것은 위치를 가져 오는 데 사용하는 코드입니다. 그러나 불행히도 "실패 콜백"을 항상 인쇄합니다.navigator.geolocation.getcurrentposition이 사파리에서 작동하지 않습니다.

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 호출이 실패합니다. 어떤 제안? 나는 이것에 능숙하지 않다.

답변

0

컴퓨터에서 Wi-Fi를 켜면 작동합니다. Safari가 Wi-Fi를 사용하여 컴퓨터를 지역화합니다 :-)

관련 문제