0
// This method accepts a `Position` object, which contains
// the current GPS coordinates
function onSuccess(position) {
var element = document.getElementById('geolocation');
element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
'Longitude: ' + position.coords.longitude + '<br />' +
'Altitude: ' + position.coords.altitude + '<br />' +
'Accuracy: ' + position.coords.accuracy + '<br />' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' +
'Heading: ' + position.coords.heading + '<br />' +
'Speed: ' + position.coords.speed + '<br />' +
'Timestamp: ' + position.timestamp + '<br />';
}
它是從PhoneGap的自己的網站約地理位置採取的例子,但有一些問題,我不能悄悄地理解,我們使用範圍COORDS'成員一樣lantitude,lontitude位置變量對象,但是我們如何創造職位在js中的對象,即使沒有可變類型的東西。的PhoneGap GeoLocation中變種類型
whoaa,速度非常快,謝謝幫助 – oknsnl 2013-04-23 15:24:24
沒問題:)!不要忘記將這個答案標記爲解決問題。 – Antoine 2013-04-24 08:19:35
你知道我該怎麼做? – oknsnl 2013-05-01 20:51:37