[OpenLayers-Users] How do I unselect a feature?

mike mike at bristolbeat.co.uk
Sat Nov 17 11:34:15 EST 2007


On 17/11/2007, mike <mike at bristolbeat.co.uk> wrote:
>
>
> I get the same behaviour - in the select-feature demo, clicking on the
> selected point unselects it, but in modify-feature it does not.
>
>
I think the dragStart event, which is used by ModifyFeature for only
OpenLayers.Geometry.Point (not lines and polygons) overrides the default
click behaviour.

If the selected object has changed, the unselect event is handled here, but
if the selection has not changed, it is not handled.  Perhaps that's what is
missing.  However, it's not that simple because the click event could be the
start of a drag action - so how to distinguish between these?

I'm guessing it would have to be fired by the mouse up event, maybee
checking to see if we did actually drag the point or not, but I can't see
how to do that at the moment...

As an aside I notice the click-drag behaviour works nicely except for the
first point selected, i.e. when nothing else is selected you have to click a
point, release, then click again and drag - a single click-drag does not
work.  Once a feature is selected, then click-drag works fine.

mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071117/0fff4e43/attachment.html


More information about the Users mailing list