[OpenLayers-Trac] Re: [OpenLayers] #3016: ModifyFeature - "del" key
press outside vertice should delete the feature
OpenLayers
trac-20090302 at openlayers.org
Thu Feb 3 03:12:34 EST 2011
#3016: ModifyFeature - "del" key press outside vertice should delete the feature
-----------------------------------+----------------------------------------
Reporter: adube | Owner: tschaub
Type: feature | Status: new
Priority: minor | Milestone: 2.11 Release
Component: Control.ModifyFeature | Version: 2.10
Keywords: del, delete, key | State: Needs More Work
-----------------------------------+----------------------------------------
Changes (by erilem):
* state: Review => Needs More Work
Comment:
I'd like not to introduce business logic in the ModifyFeature control. For
example, with [attachment:patch-modifyfeature-3016-r11065-A0.diff],
pressing 'd' systematically destroys the feature if its fid is undefined,
and I guess different behaviors may be wanted here.
My propositions:
* we add a {{{featurestatechanged}}} event type to {{{Layer.Vector}}}
* we make {{{Feature.Vector.setState}}} trigger a
{{{featurestatechanged}}} event
* when 'd' is pressed we just do
{{{feature.setState(OpenLayers.State.DELETE)}}}
* the rest is business logic
We should also modify {{{Control.ModifyFeature}}},
{{{Control.DrawFeature}}}, {{{Control.Split}}}, {{{Handler.Polygon}}} to
use {{{Feature.setState}}}.
I hope it makes sense.
--
Ticket URL: <http://trac.openlayers.org/ticket/3016#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list