I am trying to display a set of rectangles on a map. I am able to draw all of them using:
var rec = L.rectangle(bounds, {color: "#ff7800", weight: 1})
.bindTooltip('Z1', { sticky: true}).addTo(map);
However, when I hover over the rectangles, the tooltip is shown only for the outer-most rectangle. Also, in click event, only the outer-most rectangle is selected. (Note that larger rectangles can be layered over smaller ones)
Given this situation - how do I show the tooltip correctly and retreive the proper layer on click event?
Stackblitz : click here