[fusion-commits] r2675 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sun Mar 24 20:32:46 PDT 2013

Author: jng
Date: 2013-03-24 20:32:46 -0700 (Sun, 24 Mar 2013)
New Revision: 2675

#555: Fix broken scalebar widget. The problem is due to a bad setTimeout call:
 - It was binding to a non-function object.
 - The bind call did not specify the "this" context.

Note that even with this fix, the scalebar widget will not be shown unless the front-end template defines a div element with an id matching the name of this widget (ie. <div id="Scalebar"></div>). This is a problem that documentation can address

Modified: trunk/widgets/Scalebar.js
--- trunk/widgets/Scalebar.js	2013-03-22 18:11:51 UTC (rev 2674)
+++ trunk/widgets/Scalebar.js	2013-03-25 03:32:46 UTC (rev 2675)
@@ -97,7 +97,7 @@
         //debugging using firebug, the problem doesn't occur.
         //A parameter or an operation is not supported by the underlying object"  code: "15
-        window.setTimeout(OpenLayers.Function.bind(this.oScaleBar, widgetTag.name), 1);
+        window.setTimeout(OpenLayers.Function.bind(this.oScaleBar.place, this.oScaleBar, widgetTag.name), 1);
         this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, OpenLayers.Function.bind(this.extentsChangedCB, this));
         this.getMap().registerForEvent(Fusion.Event.MAP_LOADED, OpenLayers.Function.bind(this.extentsChangedCB, this));

More information about the fusion-commits mailing list