diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js index 2567b24fff..1db58309dd 100644 --- a/lib/OpenLayers/Control/Permalink.js +++ b/lib/OpenLayers/Control/Permalink.js @@ -31,9 +31,10 @@ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, { * Parameters: * element - {DOMElement} * base - {String} + * options - {Object} options to the control. */ - initialize: function(element, base) { - OpenLayers.Control.prototype.initialize.apply(this, arguments); + initialize: function(element, base, options) { + OpenLayers.Control.prototype.initialize.apply(this, [options]); this.element = OpenLayers.Util.getElement(element); this.base = base || document.location.href; }, diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index c8d8e3c9b8..857e83d75c 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -24,10 +24,10 @@ OpenLayers.Control.Scale = OpenLayers.Class(OpenLayers.Control, { * * Parameters: * element - {DOMElement} - * base - {String} + * options - {Object} */ - initialize: function(element) { - OpenLayers.Control.prototype.initialize.apply(this, arguments); + initialize: function(element, options) { + OpenLayers.Control.prototype.initialize.apply(this, [options]); this.element = OpenLayers.Util.getElement(element); }, diff --git a/tests/Control/test_Permalink.html b/tests/Control/test_Permalink.html index 26cc1b0f2b..9b924e0b7b 100644 --- a/tests/Control/test_Permalink.html +++ b/tests/Control/test_Permalink.html @@ -19,6 +19,12 @@ map.events.triggerEvent("changelayer", {}); t.ok(true, "permalink didn't bomb out."); } + function test_02_Control_Permalink_initwithelem (t) { + t.plan( 1 ); + + control = new OpenLayers.Control.Permalink(OpenLayers.Util.getElement('permalink')); + t.ok(true, "If the above line doesn't throw an error, we're safe."); + } function test_02_Control_Permalink_updateLinks (t) { t.plan( 3 ); diff --git a/tests/Control/test_Scale.html b/tests/Control/test_Scale.html index 05fa69a0c1..f00729f378 100644 --- a/tests/Control/test_Scale.html +++ b/tests/Control/test_Scale.html @@ -10,6 +10,12 @@ t.ok( control instanceof OpenLayers.Control.Scale, "new OpenLayers.Control returns object" ); t.eq( control.displayClass, "olControlScale", "displayClass is correct" ); } + function test_02_Control_Scale_initwithelem (t) { + t.plan( 1 ); + + control = new OpenLayers.Control.Scale(OpenLayers.Util.getElement('scale')); + t.ok(true, "If this happens, then we passed. (FF throws an error above otherwise)"); + } function test_02_Control_Scale_updateScale (t) { t.plan( 4 );