[fusion-commits] r1419 - in trunk: lib widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Mon Jun 23 12:07:35 EDT 2008
Author: madair
Date: 2008-06-23 12:07:34 -0400 (Mon, 23 Jun 2008)
New Revision: 1419
Modified:
trunk/lib/Map.js
trunk/widgets/ViewOptions.js
Log:
re #73: view options patch applied to trunk
Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2008-06-10 18:13:13 UTC (rev 1418)
+++ trunk/lib/Map.js 2008-06-23 16:07:34 UTC (rev 1419)
@@ -152,6 +152,8 @@
this.registerEventID(Fusion.Event.MAP_SELECTION_ON);
this.registerEventID(Fusion.Event.MAP_SELECTION_OFF);
+ this.registerForEvent(Fusion.Event.MAP_LOADED, OpenLayers.Function.bind(this.mapLoaded,this));
+
//register for OL map extent change events
this.oMapOL.events.register('moveend', this, this.mapExtentsChanged);
@@ -163,6 +165,10 @@
this.bFetchingSelection = false;
},
+ mapLoaded: function() {
+ this.setViewOptions(this.getUnits());
+ },
+
setMenu: function() {
if (this.widgetTag.extension.MenuContainer) {
var contextMenu = new Jx.ContextMenu();
@@ -684,6 +690,25 @@
return this._fMetersperunit;
},
+ /**
+ *
+ * initializes all widgets with the map units after the map has loaded
+ *
+ */
+ setViewOptions: function(data) {
+ for (var i=0; i<Fusion.applicationDefinition.widgetSets.length; ++i) {
+ var widgetSet = Fusion.applicationDefinition.widgetSets[i];
+ for (var j=0; j<widgetSet.widgetInstances.length; ++j) {
+ var widget = widgetSet.widgetInstances[j];
+ for (var k=0; k<widget.paramRegister.length; ++k) {
+ if (widget.paramRegister[k] == 'Units') {
+ widget.setParameter('Units', data);
+ }
+ }
+ }
+ }
+ },
+
/**
*
* convert geographic into pixels.
Modified: trunk/widgets/ViewOptions.js
===================================================================
--- trunk/widgets/ViewOptions.js 2008-06-10 18:13:13 UTC (rev 1418)
+++ trunk/widgets/ViewOptions.js 2008-06-23 16:07:34 UTC (rev 1419)
@@ -67,20 +67,6 @@
setMapUnits: function() {
var units = this.displayUnits ? this.displayUnits : this.getMap().getUnits();
- this.setViewOptions(units);
- },
-
- setViewOptions: function(data) {
- for (var i=0; i<Fusion.applicationDefinition.widgetSets.length; ++i) {
- var widgetSet = Fusion.applicationDefinition.widgetSets[i];
- for (var j=0; j<widgetSet.widgetInstances.length; ++j) {
- var widget = widgetSet.widgetInstances[j];
- for (var k=0; k<widget.paramRegister.length; ++k) {
- if (widget.paramRegister[k] == 'Units') {
- widget.setParameter('Units', data);
- }
- }
- }
- }
+ this.getMap().setViewOptions(units);
}
});
More information about the fusion-commits
mailing list