[OpenLayers-Trac] Re: [OpenLayers] #3046: Popup can't be closed

OpenLayers trac-20090302 at openlayers.org
Wed Mar 16 05:41:39 EDT 2011


#3046: Popup can't be closed
---------------------------------+------------------------------------------
 Reporter:  pebXX2346            |       Owner:              
     Type:  bug                  |      Status:  new         
 Priority:  minor                |   Milestone:  2.11 Release
Component:  examples             |     Version:  SVN         
 Keywords:  Popup Strategy BBOX  |       State:  Review      
---------------------------------+------------------------------------------

Comment(by crschmidt):

 (In [11707]) The dynamic text layer uses an onPopupClose which looks to
 the layer and
 first calls unselect on the selectfeaturecontrol. However, this fails if
 the feature in question is no longer in the map -- for example, if you
 zoom
 in or otherwise change positions. (The selected feature no longer exists,
 so you call close on a feature which no longer has a layer object.) This
 change
 to the examples by Jorix fixes this behavior in the example.

 Note that many people use similar functionalities in their code, so this
 likely means that what we *should* do is armor unselect() against being
 called with a feature with a null layer, but that involves a longer
 discussion -- do we still fire onUnselect? Do we still fire the unselect
 events? is there other cleanup we need to do? etc. -- so this is changing
 the example to demonstrate one way to armor application code against
 the problem.

 Thanks to jorix for the suggestion on the example fix.
 (See #3046)
 (See #2515)

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


More information about the Trac mailing list