Hi all,
I am using OpenLayers trunk at rev 12352. I noticed that when I
attempt to create a Control.Scale object with any options, it would
fail to work:
new OpenLayers.Control.Scale( {
div: document.getElementById('scalediv'),
geodesic: true
} ),
However, if I add no options, then the Scale control would appear in
its default position inside the map.
new OpenLayers.Control.Scale( ),
Seeing that the ScaleLine control worked fine for me, and that
ScaleLine is a close copy of the Scale control I began looking for
differences. As a result, I deleted the Scale::initialize() function
in favor of inheriting from Control::initialize() instead just as
ScaleLine does.
The result is that I can now enable geodesic and move my Scale control
outside the map into my own div.
Patch is attached.
I greatly appreciate the work all have put into OpenLayers, and hope
this helps contribute something (however trivial) back.
Regards,
Tim
Index: lib/OpenLayers/Control/Scale.js
===================================================================
--- lib/OpenLayers/Control/Scale.js (revision 12352)
+++ lib/OpenLayers/Control/Scale.js (working copy)
@@ -35,18 +35,6 @@
geodesic: false,
/**
- * Constructor: OpenLayers.Control.Scale
- *
- * Parameters:
- * element - {DOMElement}
- * options - {Object}
- */
- initialize: function(element, options) {
- OpenLayers.Control.prototype.initialize.apply(this, [options]);
- this.element = OpenLayers.Util.getElement(element);
- },
-
- /**
* Method: draw
*
* Returns:
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users