As an example I implemented a method wich shows me all the geolocation stuff.
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 />';
}
so I took a walk arround the block pressing this button:
<input type="submit" data-theme="d" name="login" id="login" value="Position" onclick="showLocation()"/>
However, the Attributes for Altitude, Heading and Speed always shows null.
Altitude Accuracy also shows null, but the phonegap docu says it´s not working with android. So why is this not working?
thanks in advance, Daniel
dev.w3.org/geo/api/spec-source.html#coordinates_interface
it might be device specific, as to whether or not those parameters are supported “If the implementation cannot provide {those variables you’re having trouble with} information, the value of this attribute must be null.”