Drawing Manager Event Fires for an drawn shape when clicking outside of the shape
Hello,
The following observation is present within both V2 SDK and the latest V3 preivew series SDKs, so I expect this annomoly has always been present since the offset.
If I subscribe to the drawing manager events, a [Drawing Started] event fires for a drawn shape, regardless of whether I'm clicking within the boundary of the shape or not.
Example use case is below, I draw a circle on the map. I would of course expect the event to fire If I click somewhere on the drawn shape itself, but I wouldn't expect the same event to fire again when clicking on an open space on the map (somewhere to one side of the drawn shape), this causes issues in how I'm using the drawing manager along with some other custom drawing tools given I'm relying on the accuracy of events to fire only when I'm clearly interacting with the chosen shape itself, not just the map in general.
In the above screenshot, there are three console.log events shown to the RHS in the browser's debug (see the expanded ones) The first and second event fired when I clicked on the circle itself (both fired at the same time) The third event fired when I clicked on the map away from the circle.
I beleive this likely happens because drawing manager stores the last known shape that was interacted with and does not flush it out when something else is clicked on that does not belong to the drawing manager. So when we interact with the map itself, the drawing manager still triggers an event as well as the map events, regardless of whether the drawn shape was interacted with or not.
The fact that the drawing manager events can often fire twice in a row is also problematic, i'm not sure if this is becuase shapes that are made up of multiple layers are each firing the drawing manager events individually. If that is the case it would be useful to add an option somewhere to prevent this.
Appreciate your report; we're aware of the issue and have already logged it as a known bug (BUG 24502135) in our backlog. Apologies for any inconvenience caused. Rest assured, once I have further details or an estimated time of resolution, I'll provide an update here. Thank you for your understanding.