Return precision value from geocoder.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Jun 2010 05:39:53 +0000 (01:39 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Jun 2010 05:39:53 +0000 (01:39 -0400)
Google's geocoder is really the only one that returns any useful information
(ve always returns 1, and yahoo doesn't return it at all).

horde/js/hordemap/google.js
horde/js/hordemap/horde.js
horde/js/hordemap/ve.js
horde/js/hordemap/yahoo.js

index 3d0fde9..68d54a6 100644 (file)
@@ -54,7 +54,7 @@ HordeMap.Geocoder.Google = Class.create(
         }
         var results = [];
         r.Placemark.each(function(entry) {
-            var ll = {lon: entry.Point.coordinates[0], lat: entry.Point.coordinates[1]};
+            var ll = {lon: entry.Point.coordinates[0], lat: entry.Point.coordinates[1], precision: entry.AddressDetails.Accuracy };
             results.push(ll);
         });
         this._userCallback(results);
index 42f2854..4f3bd5a 100644 (file)
@@ -108,6 +108,11 @@ HordeMap.Map.Horde = Class.create({
         this.map.zoomToMaxExtent();
     },
 
+    getZoom: function()
+    {
+        return this.map.getZoom();
+    },
+
     display: function(n)
     {
         if (Object.isUndefined(this.map)) {
index 65349d7..13eabb5 100644 (file)
@@ -93,7 +93,7 @@ HordeMap.Geocoder.Ve = Class.create(
             var results = [];
             if (p) {
                 p.each(function(entry) {
-                    results.push({ lon: entry.LatLong.Longitude, lat: entry.LatLong.Latitude, precision: entry.Precision });
+                    results.push({ lon: entry.LatLong.Longitude, lat: entry.LatLong.Latitude, precision: 1 });
                 });
                 this._completeCallback(results);
             }
index 6b164d3..6f13179 100644 (file)
@@ -79,7 +79,7 @@ HordeMap.Geocoder.Yahoo = Class.create(
     _callback: function(p)
     {
         if (p.success) {
-            var results = [ { lon: p.GeoPoint.Lon, lat: p.GeoPoint.Lat, address: p.Address}];
+            var results = [ { lon: p.GeoPoint.Lon, lat: p.GeoPoint.Lat, address: p.Address, precision: 1}];
         }
 
         this._completeCallback(results);