예를 들어 모든 지리적 위치 정보를 보여주는 방법을 구현했습니다. 제목, 고도를 위해, 그러나 속성을phonegap android geolocation. 일부 속성은 항상 null입니다.
<input type="submit" data-theme="d" name="login" id="login" value="Position" onclick="showLocation()"/>
과 속도는 항상 null을 보여줍니다
function showLocation() {
navigator.geolocation.getCurrentPosition(onGeoSuccess, onGeoError);
}
function onGeoSuccess(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: ' + new Date(position.timestamp) + '<br />';
}
그래서이 버튼을 누르면 블록 arround를 산책했다. 고도 정확도도 null로 표시되지만 휴대 전화 docu는 안드로이드와 작동하지 않는다고 말합니다. 그럼 왜 이것이 작동하지 않습니까? 사전에 덕분에, 다니엘
http://dev.w3.org/geo/api/spec-source.html#coordinates_interface 해당 매개 변수가 지원되는지 여부와 관련하여 장치마다 다를 수 있습니다. "구현시 {해당 변수를 제공 할 수없는 경우 { 정보에 문제가있는 경우이 속성의 값은 null이어야합니다. " –
아, 그게 두려웠습니다. 고마워요. 귀하가 귀하의 의견을 하나에 복사하면 귀하의 답변을 수락하십시오. – dan