[OpenLayers-Trac] [OpenLayers] #685: WFS markers are drawn when layer is not in range...

OpenLayers trac at openlayers.org
Tue Aug 28 04:37:07 EDT 2007


#685: WFS markers are drawn when layer is not in range...
---------------------------+------------------------------------------------
  Reporter:  johnwebbcole  |       Owner:             
      Type:  feature       |      Status:  new        
  Priority:  minor         |   Milestone:  2.5 Release
 Component:  Layer.WFS     |     Version:  2.4 RC2    
Resolution:                |    Keywords:  review     
---------------------------+------------------------------------------------
Comment (by euzuro):

 so i just looked at this and i think the real problem here is in Map.js

 in the setCenter() function is the core place where we're doing tests on
 layers' inRange-ness. As we cycle through the map's overlays, we do this:

 {{{
                     var inRange = layer.calculateInRange();
                     if (layer.inRange != inRange) {
                         // Layer property has changed. We are going
                         // to call moveLayer so that the layer can be
 turned
                         // off or on.
                         layer.inRange = inRange;
                         moveLayer = true;
                         this.events.triggerEvent("changelayer");
                     } else {
                         // If nothing has changed, then we only move the
 layer
                         // if it is visible and inrange.
                         moveLayer = (layer.visibility && layer.inRange);
                     }
 }}}

 Which seems wise but really it's the reason for this problem. we check if
 the layer's inRange-ness *changes*, and if it does, then we automatically
 call moveTo() on it. Really, we should check if it changes, and if the new
 inRange is true, then we should moveTo. If it changes and the new inRange
 is *false*, then we should simply call display(false) on the layer.

 no? thoughts? sorry i dont have time to make a patch for this.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/685#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list