Make the Google Client Location API's output compliant with the w3c geolocation specification

This commit is contained in:
Craig Andrews 2009-11-20 15:06:31 -05:00
parent b688c572c9
commit a3285faac1
1 changed files with 11 additions and 10 deletions

View File

@ -161,22 +161,23 @@ var AjaxGeoLocation = (function() {
var cl = google.loader.ClientLocation; var cl = google.loader.ClientLocation;
var position = { var position = {
latitude: cl.latitude, coords: {
longitude: cl.longitude, latitude: cl.latitude,
altitude: null, longitude: cl.longitude,
accuracy: 43000, // same as Gears accuracy over wifi? altitude: null,
altitudeAccuracy: null, accuracy: 43000, // same as Gears accuracy over wifi?
heading: null, altitudeAccuracy: null,
velocity: null, heading: null,
timestamp: new Date(), speed: null,
},
// 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);