[fusion-trac] #344: Object drawn by Redline with consumer map didn't display until Zoom map.

Fusion trac_fusion at osgeo.org
Thu Dec 3 22:20:30 EST 2009


#344: Object drawn by Redline with consumer map didn't display until Zoom map.
---------------------+------------------------------------------------------
 Reporter:  liuar    |         Owner:  madair 
     Type:  defect   |        Status:  new    
 Priority:  P2       |     Milestone:  Future 
Component:  Widgets  |       Version:  1.1.1  
 Severity:  Major    |    Resolution:         
 Keywords:           |   External_id:  1281964
    State:  New      |       Browser:  All    
       Os:  All      |  
---------------------+------------------------------------------------------
Comment (by liuar):

 Updated the resoution per Paul's suggestion.
 Added a function named moveLayerToTop for moving the redline layer to the
 top and redrawing it after feature added in this layer.
 [[BR]]

 {{{
     ....

     featureAdded: function(evt) {
         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();
     },

     ...
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/344#comment:2>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list