mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
Adding altituteAccuracy into Coordinates object
This commit is contained in:
parent
86d6053d2d
commit
b1af7d8739
@ -29,7 +29,7 @@ Geolocation.prototype.gotCurrentPosition = function(lat, lng, alt, altacc, head,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
coords = new Coordinates(lat, lng, alt, altacc, head, vel);
|
coords = new Coordinates(lat, lng, alt, acc, head, vel);
|
||||||
loc = new Position(coords, stamp);
|
loc = new Position(coords, stamp);
|
||||||
this.lastPosition = loc;
|
this.lastPosition = loc;
|
||||||
this.global_success(loc);
|
this.global_success(loc);
|
||||||
@ -58,7 +58,7 @@ Geolocation.prototype.watchPosition = function(successCallback, errorCallback, o
|
|||||||
*/
|
*/
|
||||||
Geolocation.prototype.success = function(key, lat, lng, alt, altacc, head, vel, stamp)
|
Geolocation.prototype.success = function(key, lat, lng, alt, altacc, head, vel, stamp)
|
||||||
{
|
{
|
||||||
var coords = new Coordinates(lat, lng, alt, altacc, head, vel);
|
var coords = new Coordinates(lat, lng, alt, acc, head, vel);
|
||||||
var loc = new Position(coords, stamp);
|
var loc = new Position(coords, stamp);
|
||||||
geoListeners[key].success(loc);
|
geoListeners[key].success(loc);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ function Position(coords, timestamp) {
|
|||||||
this.timestamp = new Date().getTime();
|
this.timestamp = new Date().getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
function Coordinates(lat, lng, alt, acc, head, vel) {
|
function Coordinates(lat, lng, alt, acc, head, vel, altacc) {
|
||||||
/**
|
/**
|
||||||
* The latitude of the position.
|
* The latitude of the position.
|
||||||
*/
|
*/
|
||||||
@ -39,6 +39,10 @@ function Coordinates(lat, lng, alt, acc, head, vel) {
|
|||||||
* The velocity with which the device is moving at the position.
|
* The velocity with which the device is moving at the position.
|
||||||
*/
|
*/
|
||||||
this.speed = vel;
|
this.speed = vel;
|
||||||
|
/**
|
||||||
|
* The altitude accuracy of the position.
|
||||||
|
*/
|
||||||
|
this.altitudeAccuracy = (altacc == "undefined") ? altacc : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user