I am currently working on a leaflet.js project that involves a baselayer, a polygon geojson layer, and another tilelayer positioned above the geojson layer displaying placenames. I have managed to successfully display the placenames tilelayer above the geojson layer by adding it to a map pane. However, this setup has caused click and hover events on the geojson layer to be disabled. I am considering adding the geojson layer to its own pane or possibly the same pane as the placenames tilelayer, but I am unsure of the best approach.
Below is the code I used to add my placenames layer to a pane:
var topPane = map.createPane('leaflet-top-pane', map.getPanes().mapPane);
topPane.appendChild(CartoDB_PositronOnlyLabels.getContainer());
Here is the CSS code for the pane:
.leaflet-top-pane {
pointer-events: none;
}
I have attempted adding my geojson layer to the same pane and adjusting the pointer-events option, but either it does not work or I have yet to find the correct solution. Does anyone have any suggestions on how I can overcome this issue so that the tilelayer overlay appears above the geojson layer while still allowing interaction with the geojson layer?