Sunday 28 February 2016

Leaflet draw: prevent drawing through a custom overlay


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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...