2016-06-22 2 views

답변

0

스레드에서 link을 따라 가면 github에 전체 예제 코드가 표시됩니다.

당신이 수행하여 현재 위치를 얻을 수 있습니다 :

var location = geolocation.getCurrentLocation({desiredAccuracy: 3, updateDistance: 10, maximumAge: 20000, timeout: 20000}). 
then(function(loc) { 
    if (loc) { 
     // Your code here 
    } 
}, function(e){ 
    console.log("Error: " + e.message); 
}); 

당신이 그것을 계속 업데이트 할

, 당신은 사용할 수 있습니다

var watchId = geolocation.watchLocation(
function (loc) { 
    if (loc) { 
     // Your code here 
    } 
}, 
function(e){ 
    console.log("Error: " + e.message); 
}, 
{desiredAccuracy: 3, updateDistance: 10, updateTime: 1000 * 20}); // should update every 20 sec according to google documentation this is not so sure. 
+0

너무 감사합니다, 이것은 내가했다 단지 무엇인가 찾고! – Terhoraj

관련 문제