From 38a33af5b5157b4865ae5698dc4f0d1d80c084a5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 17 Jun 2010 01:39:53 -0400 Subject: [PATCH] Return precision value from geocoder. 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 | 2 +- horde/js/hordemap/horde.js | 5 +++++ horde/js/hordemap/ve.js | 2 +- horde/js/hordemap/yahoo.js | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/horde/js/hordemap/google.js b/horde/js/hordemap/google.js index 3d0fde90a..68d54a617 100644 --- a/horde/js/hordemap/google.js +++ b/horde/js/hordemap/google.js @@ -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); diff --git a/horde/js/hordemap/horde.js b/horde/js/hordemap/horde.js index 42f28544c..4f3bd5a2b 100644 --- a/horde/js/hordemap/horde.js +++ b/horde/js/hordemap/horde.js @@ -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)) { diff --git a/horde/js/hordemap/ve.js b/horde/js/hordemap/ve.js index 65349d732..13eabb504 100644 --- a/horde/js/hordemap/ve.js +++ b/horde/js/hordemap/ve.js @@ -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); } diff --git a/horde/js/hordemap/yahoo.js b/horde/js/hordemap/yahoo.js index 6b164d32c..6f1317949 100644 --- a/horde/js/hordemap/yahoo.js +++ b/horde/js/hordemap/yahoo.js @@ -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); -- 2.11.0