From: Michael J. Rubinsky Date: Wed, 14 Apr 2010 22:28:09 +0000 (-0400) Subject: Don't hardcode non-horde drivers in the bootstrap file. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b814a0b01d4840161235125f0e0a1b1695f6d602;p=horde.git Don't hardcode non-horde drivers in the bootstrap file. This allows other map drivers to be added without having to edit existing horde code. As a result of this change, any drivers other then the native openlayers-based horde driver are now responsible for bringing in any other js dependencies they require (such as externally served api files). --- diff --git a/horde/js/hordemap/map.js b/horde/js/hordemap/map.js old mode 100644 new mode 100755 index ff59d005e..503c5446b --- a/horde/js/hordemap/map.js +++ b/horde/js/hordemap/map.js @@ -1,5 +1,16 @@ /** - * Initial bootstrap file for hordemap + * Initial bootstrap file for hordemap. + * + * This file is responsible for loading the javascript for the map driver we are + * using. Horde ships with a Horde driver that relies on OpenLayers.js. The + * Horde driver is able to support any mapping provider that can serve map + * tiles. We have built in support for Google, Yahoo, and Bing as well as built + * in support for OpenStreetMaps. To write a new driver to support a new + * provider, include a new {drivername}.js file in the same directory as this + * file. Your js file is responsible for including any additional javascript + * files you may need (such as externally served api files for example). Take + * a look at the public.js or google.js files for the interface that needs to be + * implemented. */ HordeMap = { @@ -35,9 +46,8 @@ HordeMap = { if (this._opts.conf.language != 'en-US') { this._addScript(path + this._opts.conf.language + '.js'); } - } else if (this._opts.driver == 'SAPO') { - this._addScript(this._getProviderUrl('SAPO')); } + this._addScript(path + this._opts.driver.toLowerCase() + '.js'); if (this._opts.geocoder) { @@ -128,8 +138,7 @@ HordeMap = { return 'http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=' + this.conf['apikeys']['yahoo']; case 'Ve': return 'http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'; - case 'SAPO': - return 'http://js.sapo.pt/Bundles/SAPOMapsAPI-1.0.js'; + default: return ''; }