Draw Interaction removeLastPoint not acting as expected
See original GitHub issueDescribe the bug When enabling the Draw interaction and calling the removeLastPoint function, the draw layer does not update.
To Reproduce Steps to reproduce the behavior:
- Add the Draw Interaction to the map with
type: 'Polygon'
- Draw a polygon and mid draw, call the
removeLastPoint
function - Observe that the polygon you were drawing does not update
- Call
removeLastPoint
again and find that the line segment that was supposed to be removed in the 1st call is now removed. - Click on the map again to resume drawing and see that the segment of call 2 is now removed and drawing has commenced as expected
Expected behavior
On removeLastPoint
call, update the map with the original geometry with the last drawn segment removed
Relevant Code https://github.com/openlayers/openlayers/blob/v6.3.1/src/ol/interaction/Draw.js#L817
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Remove last point from Draw Interaction in Ol3 - Stack Overflow
The following code do not work. It seems to remove it when it draw the area part, but the vertex is stil there....
Read more >Opening A Closed Polygon In Openlayers To Continue Drawing
Describe the bug When enabling the Draw interaction and calling the removeLastPoint function the draw layer does not update. To Reproduce Steps to...
Read more >Undoing last point when drawing linestring in OpenLayers 3?
Since OpenLayers 3.9.0, this is as simple as using the removeLastPoint method of the DrawInteraction . So you can do something like this:...
Read more >OpenLayers v4.6.5 API - Class: Draw
Geometry name to use for features created by the draw interaction. condition, ol. ... Remove last point of the feature currently being drawn....
Read more >Creating Lively Regions: February 2002, Volume 8 Number 2 | PDF ...
Similarly, buttons and menu items always look like you expect them to look, so youre accustomed to using them no matter what application...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The cleanest solution is probably to render the sketch point in some way, but with a modified
condition
you could make the sketch point appear at the last clicked location:I think this problematic if I remove the second point of a line or polygon. If I have a style that does not draw single points and remove the second point, the whole feature disappears until I move the mouse. This was seen as error by the users.