[OpenLayers-Trac] Re: [OpenLayers] #2515: Zooming in while a popup
is open makes that
popup impossible to close (raises a 'layer is null' error in
OpenLayers.js (line 1697))
OpenLayers
trac-20090302 at openlayers.org
Wed Mar 16 05:41:37 EDT 2011
#2515: Zooming in while a popup is open makes that popup impossible to close
(raises a 'layer is null' error in OpenLayers.js (line 1697))
-------------------------------------------------+--------------------------
Reporter: jonathanwlowe | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.11 Release
Component: general | Version: 2.8
Keywords: layer, is, null, popup, close, open | State:
-------------------------------------------------+--------------------------
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/2515#comment:2>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list