[fusion-commits] r2009 - trunk/widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Sun Dec 6 21:06:14 EST 2009
Author: liuar
Date: 2009-12-06 21:06:12 -0500 (Sun, 06 Dec 2009)
New Revision: 2009
Modified:
trunk/widgets/Redline.js
Log:
Fixed Ticket 344 http://trac.osgeo.org/fusion/ticket/344
Object drawn by Redline with consumer map didn't display until Zoom map.
Modified: trunk/widgets/Redline.js
===================================================================
--- trunk/widgets/Redline.js 2009-12-04 18:00:25 UTC (rev 2008)
+++ trunk/widgets/Redline.js 2009-12-07 02:06:12 UTC (rev 2009)
@@ -218,9 +218,23 @@
},
featureAdded: function(evt) {
- this.triggerEvent(Fusion.Event.REDLINE_FEATURE_ADDED, evt.feature);
+ this.triggerEvent(Fusion.Event.REDLINE_FEATURE_ADDED, evt.feature);
+ this.moveLayerToTop(evt.feature.layer);
},
-
+
+ // move the redline layer to the top and redraw it
+ moveLayerToTop: function(layer) {
+ var map = layer.map;
+ var baseIndex = map.getLayerIndex(layer);
+
+ if(baseIndex != layer.map.layers.length-2)
+ {
+ // except for the current temp drawing layer, the redline layer is not on the top of the map.
+ map.setLayerIndex(layer,layer.map.layers.length-2)
+ }
+ layer.redraw();
+ },
+
// change active layer
activateLayer: function(layerIndex) {
this.activeLayer = this.vectorLayers[layerIndex];
More information about the fusion-commits
mailing list