[OpenLayers-Users] Is it possible to delete a point using the ModifyFeature control?

Andreas Hocevar andreas.hocevar at gmail.com
Sat May 17 14:29:50 EDT 2008


On 5/15/08, Eric Lemoine <eric.c2c at gmail.com> wrote:
> On Wed, May 14, 2008 at 10:29 PM, Andreas Hocevar
> <andreas.hocevar at gmail.com> wrote:
>> Pierre GIRAUD wrote:
>>>
>>> I think Eric is wrong on that point.
>>> By hovering a vertex, you can delete it pressing the Del button.
>>> Tricky, isn't it ?
>>>
>>
>> I would have thought that it works like that, because it is promised in
>> the
>> API doc of Control.ModifyFeature, but it does not:
>
> Indeed, the API doc isn't correct.
>
> We cannot delete polygons et lines with the modify feature control, so
> why would we allow deleting points? Maybe you think that the control
> should allow deleting features?

I was thinking that a feature gets deleted when we remove its last
vertex. But then, this would also mean if there are only 3 vertices of
a polygon left and we delete one we end up having a line, and if we
delete another vertex we get a point. Not a good idea to do it like
that. So you convinced me that the current behaviour is desirable, and
that only the API doc is incorrect.

>> Also, handleKeypress is only triggered when the point is not selected.
>
> I don't get that. Could you please elaborate?

I set a breakpoint using Firebug in the handleKeypress method of
Control.ModifyFeature, and found out that this one only gets triggered
(for a point) when the point is not selected (i.e. "blue") while
hovering over it.

Regards,
Andreas.



More information about the Users mailing list