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) git-svn-id: http://svn.openlayers.org/trunk/openlayers@11707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
4.6 KiB
4.6 KiB