Skip to content

Provide the vertex index in the ModifyFeatureControl / Vector "vertexremoved" event. #1408

@mmacfadden

Description

@mmacfadden

Currently, the vertexremoved event contains the feature, vertex, and pixel of the removed vertex. This information is not sufficient to determine where the vertex that was removed "was" in the parent geometry. We need to know the position within the parent geometry that the vertex occupied prior to it being removed. The point is removed before the event is fired, so there is now way to interrogate the data to determine the position.

I see three options to provide this functionality:

  1. Fire the event before the vertex is removed.
  2. Fire a new event "beforevertexremoved".
  3. Add the old index to the current event.

Option #1 is not acceptable since many applications may depend on the current event being fired after the removal.

Option #2 seems to be less risky, but adds another event that is probably hyper-specific to this scenario, and could muddy the API.

Option #3 is a good options since it does not affect the current API and is backwards compatible. It can also be implemented in about 3 lines of code.

I plan on submitting a pull request implementing Option #3 for community review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions