From: Michael J. Rubinsky Date: Fri, 12 Feb 2010 20:47:40 +0000 (-0500) Subject: Add a Null HordeMap.Geocoder driver and add to Kronolith X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c7dfe7056da2dfd60ee24e9031ad7eec3fa4fd84;p=horde.git Add a Null HordeMap.Geocoder driver and add to Kronolith Returns error for geocoding requests and lat/lng pair for reverse geocoding requests --- diff --git a/horde/js/hordemap/map.js b/horde/js/hordemap/map.js index a5f695ba5..0dec8915e 100644 --- a/horde/js/hordemap/map.js +++ b/horde/js/hordemap/map.js @@ -130,7 +130,33 @@ HordeMap = { } }, - Geocoder: { - Horde: {} // TODO - } + /** + * Base Geocoder implementations. + * The Horde Class will implement a geocoding service utilizing the various + * Horde_Ajax_Imple_Geocoder_* classes. Mapping providers that include + * geocoding services will have HordeMap.Geocoder implementations in their + * respective *.js files. The Null driver provides fallback implementaions + * for those without geocoder support. + * + */ + Geocoder: {} }; + +HordeMap.Geocoder.Horde = Class.create({}); +HordeMap.Geocoder.Null = Class.create({ + + initialize: function(opts) + { + }, + + geocode: function(address, callback, onErrorCallback) + { + return onErrorCallback('No geocoding support'); + }, + + reverseGeocode: function(lonlat, completeCallback, errorCallback) + { + var ll = { lon: lonlat.lon, lat: lonlat.lat, address: lonlat.lon + ' ' + lonlat.lat}; + return completeCallback([ll]); + } +}); diff --git a/kronolith/config/conf.xml b/kronolith/config/conf.xml index 393ca2b82..e9c094e8a 100644 --- a/kronolith/config/conf.xml +++ b/kronolith/config/conf.xml @@ -109,7 +109,7 @@ - false + Null Google Ve Yahoo @@ -130,7 +130,7 @@ - false + Null SAPO Google Ve diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 66a6d08c0..6b4142270 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3731,7 +3731,7 @@ KronolithCore = { onGeocodeError: function(r) { - KronolithCore.showNotifications([ { type: 'horde.error', message: Kronolith.text.geocode_error } ]); + KronolithCore.showNotifications([ { type: 'horde.error', message: Kronolith.text.geocode_error + ' ' + r} ]); },