-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Draw_control.features is inaccurate after editing a drawn object #1899
Comments
@nyehughes Thank you for reporting. I can confirm this bug with the geemap.core module. Editing the drawn geometries appear to add new features into @sufyanAbbasi @naschmitz Would you be able to look into this? import ee
import geemap.core as geemap
m = geemap.Map()
m |
I'm all booked up for today, but I'll take a look first thing on Monday. Thanks for finding, nyehughes@. |
Sorry it took so long. Just dug into this issue. There's an underlying bug with Aside, you should be able to access the underlying geometries for the shapes drawn on the map with Looked into your question about |
Environment Information
Python 3.11.6, geemap : 0.30.4, ee : 0.1.384, ipyleaflet : 0.17.3, running under Solara 1.25.1
Description
The draw_control.features list doesn't accurately reflect drawn features on the map after using the edit control. In turn, I believe the same problem is also affecting: draw_control.collections, map.user_roi, etc
Expected behaviour:
After editing an object using the buttons on the map, the draw_control.feature list should update to reflect the new edited geometry.
Observed behaviour:
After editing and clicking save, an extra feature is added to draw_control.features. After each edit and save, the number of extra objects in the draw_controls.features list goes up by one. This makes impossible to, e.g. accurately calculate the area of the geometry drawn on the map.
How to reproduce
Given the following code:
Draw a square polygon on the map. Console reads:
A draw event occurred of type: created, and the draw control features length is: 1
Edit the square using the edit button and click 'Save'. Console reads:
A draw event occurred of type: edited, and the draw control features length is: 2
Edit the square again. Console reads:
A draw event occurred of type: edited, and the draw control features length is: 3
(Also, is the 'traget' parameter of Map.draw_control.on_draw() a typo? Should it be 'target'?)
The text was updated successfully, but these errors were encountered: