-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to delete vertices with the Modify interaction #1283
Conversation
cc @oterral - I heard you'll be porting the editing tools to the vector-api branch. |
Thx @ahocevar I'll try to integrate that in the vector-api |
I think this is nice behavior, but I'm seeing some assertion errors when trying to delete shared vertices. I haven't narrowed it down to an easily repeatable sequence, but I periodically see assertion errors with this stack:
And here is a picture: |
Thanks for spotting this @tschaub. I'll investigate this further and try to come up with a fix. |
Note to /self: double-check iterator variable name in nested loop. @tschaub: The issue should be fixed now. |
@tschaub, the above was only part of the fix. Looks like there is a 2nd issue. Working on that one now. |
@tschaub The "issue" shown in the picture is unrelated to the failing assertion. The picture shows what happens when a vertex is deleted from multiple geometries where neighboring segments have different vertices on each geometry. Regarding the assertion, it seems like an issue with RBush's extent lookup. But so far I have been unable to nail it down. Doing more research now. |
Right, I just included the picture to show you where I was editing. I didn't mean to imply that the picture itself demonstrated the issue. Apologies for the confusion. |
No worries @tschaub - the picture helped indeed to find a way to consistently reproduce the RBush problem. |
For what it's worth, now that #1373 is fixed, vertex deletion works as expected again. |
This needs to be ported to the new Modify interaction. I'll be doing this shortly. |
Updated. Thanks for any review. |
Tested on safari/chrome mac. Works great!!! |
I'm wondering if it makes sense to require a more explicit action for vertex deletion. No ideas at the moment, but I'm concerned that people might inadvertently delete points when they are trying to do something else. For example, if you are working with small features and are trying to select a feature adjacent to an already selected feature, you can end up deleting points instead of selecting the new feature (this is related to the comments in #1914). Part of this could be ameliorated by a smaller Any thoughts @ahocevar? |
I think reducing the As an alternative to this, we could introduce a delete modifier (Meta/Alt key?). But that might raise usability issues too. If we add an undo functionality, accidental vertex deletion should not be a problem any more. |
A lower tolerance plus a promise of undo in the future is probably enough. We could also add support for a delete condition in the future, but leave the default always. |
After this change, vertices can be deleted by simply clicking on them. This is the same behaviour as e.g. in geojson.io.
Ticket for undo created: #1919. |
Add a way to delete vertices with the Modify interaction
* @type {ol.Coordinate} | ||
* @private | ||
*/ | ||
this.lastVertexCoordinate_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property should be initialized (to null
).
Sorry for the post-merge review. I just added a comment regarding the initialization of the lastVertexCoordinate_ property. Thanks. |
After this change, vertices can be deleted by simply clicking on
them. This is the same behaviour as e.g. in geojson.io.