I have a leaflet draw implementation (in Angular) with a custom sidebar that overlaps the Map. It should not be possible to draw through that sidebar. For circlemarkers I could solve this problem easily by using
pointer-events: all;
and
event.stopPropagation();
for the clickevents. That way any clicks will not arrive on the map, so no circlemarker is drawn.
My problem: this solution does not work when drawing eg. rectangles. Even with the code above, any click on the sidebar starts drawing a new rectangle or finishes the drawing of a rectangle.
How can I prevent the Map from registering these events on top of the sidebar. Why does it work for circlemarkers an not for polygons?
No comments:
Post a Comment