From: Michael J. Rubinsky Date: Thu, 17 Jun 2010 05:39:53 +0000 (-0400) Subject: Return precision value from geocoder. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=38a33af5b5157b4865ae5698dc4f0d1d80c084a5;p=horde.git 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). --- 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);