forked from GNUsocial/gnu-social
Make the Google Client Location API's output compliant with the w3c geolocation specification
This commit is contained in:
parent
b688c572c9
commit
a3285faac1
@ -161,22 +161,23 @@ var AjaxGeoLocation = (function() {
|
|||||||
var cl = google.loader.ClientLocation;
|
var cl = google.loader.ClientLocation;
|
||||||
|
|
||||||
var position = {
|
var position = {
|
||||||
|
coords: {
|
||||||
latitude: cl.latitude,
|
latitude: cl.latitude,
|
||||||
longitude: cl.longitude,
|
longitude: cl.longitude,
|
||||||
altitude: null,
|
altitude: null,
|
||||||
accuracy: 43000, // same as Gears accuracy over wifi?
|
accuracy: 43000, // same as Gears accuracy over wifi?
|
||||||
altitudeAccuracy: null,
|
altitudeAccuracy: null,
|
||||||
heading: null,
|
heading: null,
|
||||||
velocity: null,
|
speed: null,
|
||||||
timestamp: new Date(),
|
},
|
||||||
|
|
||||||
// extra info that is outside of the bounds of the core API
|
// extra info that is outside of the bounds of the core API
|
||||||
address: {
|
address: {
|
||||||
city: cl.address.city,
|
city: cl.address.city,
|
||||||
country: cl.address.country,
|
country: cl.address.country,
|
||||||
country_code: cl.address.country_code,
|
country_code: cl.address.country_code,
|
||||||
region: cl.address.region
|
region: cl.address.region
|
||||||
}
|
},
|
||||||
|
timestamp: new Date()
|
||||||
};
|
};
|
||||||
|
|
||||||
successCallback(position);
|
successCallback(position);
|
||||||
|
Loading…
Reference in New Issue
Block a user