Not all lines are being deleted upon updating a polygon shape on the map. Specifically, the first line often remains after the update, despite logs indicating that deletion methods are being called correctly. We've confirmed through logs that the IDs for old lines are being passed to the draw.delete method, and the method is executed without any logged errors.
Steps to Reproduce
Draw a polygon on the map.
Use the provided method to create lines within the polygon.
Move the polygon to trigger an update.
Observe that the first line is not deleted visually, although the logs suggest it should be.
Expected Behavior
All lines associated with the old polygon shape should be deleted before new lines are drawn based on the updated polygon shape.
Actual Behavior
All lines except for the first are deleted. The first line remains on the map, leading to duplication and overlap when the polygon is moved.
Possible Solution
Investigate the deletion process to ensure that all lines are being removed as expected. It might be related to how the draw.delete method handles the deletion of the first line or a synchronization issue with the map's rendering.
Check if there is an off-by-one error in the line indexing during the deletion process.
Review and confirm the asynchronous behavior of the map update and line deletion sequence.
Add error handling around the draw.delete method to catch any silent failures.
Description
Not all lines are being deleted upon updating a polygon shape on the map. Specifically, the first line often remains after the update, despite logs indicating that deletion methods are being called correctly. We've confirmed through logs that the IDs for old lines are being passed to the draw.delete method, and the method is executed without any logged errors.
Steps to Reproduce
Expected Behavior
All lines associated with the old polygon shape should be deleted before new lines are drawn based on the updated polygon shape.
Actual Behavior
All lines except for the first are deleted. The first line remains on the map, leading to duplication and overlap when the polygon is moved.
Possible Solution