0
我正在開發一個jQuery移動應用程序。我需要跟蹤用戶的位置(城市地址)。如何使用GPS追蹤jQuery手機應用程序的位置?
var x=document.getElementById("demo");
function getLocation()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
}
else {
x.innerHTML="Geolocation is not supported by this browser.";
}
}
function showPosition(position)
{
x.innerHTML="Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude;
}
這隻給出經度和緯度。我不需要經緯度或地圖。我只需要得到城市地址。我必須做些什麼來得到這個?