Allow passing a jsuri parameter to specify where to find the hordemap js files
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Jun 2010 21:22:41 +0000 (17:22 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Jun 2010 21:25:29 +0000 (17:25 -0400)
horde/js/hordemap/map.js

index 65f6503..5b33ad9 100644 (file)
@@ -23,9 +23,10 @@ HordeMap = {
      * Initialize hordemap javascript
      *
      * @param object opts  Hash containing:
-     *      'driver': HordeMap driver to use (Horde | SAPO)
-     *      'geocoder': Geocoder driver to use
-     *      'providers': default provider layers to add (Google, Yahoo etc...)
+     *      'driver':    HordeMap driver to use (Horde | SAPO)
+     *      'geocoder':  Geocoder driver to use
+     *      'providers': Default provider layers to add (Google, Yahoo etc...)
+     *      'jsuri':     The uri to the hordemap directory
      *
      *      'conf': Any driver specific config settings such as:
      *          'language':
@@ -39,8 +40,13 @@ HordeMap = {
      */
     initialize: function(opts)
     {
+        var path;
         this._opts = opts;
-        var path = this._getScriptLocation();
+        if(!opts.jsuri) {
+            path = this._getScriptLocation();
+        } else {
+            path = opts.jsuri;
+        }
         this.conf = this._opts.conf;
         if (this._opts.driver == 'Horde') {
             this._addScript(path + 'OpenLayers.js');