javascript - Cordova Geolocation --- Altitude Not Work -
i using plugin geolocation of cordova , works , except altitude . problem or not possible have value ? plugin code , my:
var onsuccess = function (posizione) { alert ('latitudine:' + position.coords.latitude + '\ n' + 'longitude:' + position.coords.longitude + '\ n' + 'altitudine:' + position.coords.altitude + '\ n' + 'precisione:' + position.coords.accuracy + '\ n' + 'altitude precisione:' + position.coords.altitudeaccuracy + '\ n' + 'intestazione:' + position.coords.heading + '\ n' + 'speed:' + position.coords.speed + '\ n' + 'timestamp:' + position.timestamp + '\ n'); }; // onerror callback riceve un oggetto positionerror // funzione onerror (errore) { alert ('codice:' + error.code + '\ n' + 'messaggio:' + error.message + '\ n'); } navigator.geolocation.getcurrentposition (onsuccess, onerror, {enablehighaccuracy: true});
i repeat , not work that.
the code works if data received satellite. before put minus recommend check availability of satellites , how code works data satellites. code:
app.positionwatchid = navigator.geolocation.watchposition( function(result){ app.alt = math.round(result.coords.altitude) || app.base_alt; app.setaltimetervalue(app.alt); }, function(){}, { timeout: 30000, maximumage: 3000, enablehighaccuracy: true } );
work fine when satellites visible , recieved null if satellites invisible. getcurrentposition works also
Comments
Post a Comment