Leaflet.streetlabels
Leaflet.streetlabels copied to clipboard
Enabling Street Labels on polygons disables existing popups
Describe the bug When I enable Streets Labels on a layer of polygon features that has a Lealfet popup, the popup no longer appears after clicking the popup.
To Reproduce Steps to reproduce the behavior:
- Open a map that has a Leaflet popup. Click the layer and the popup window appears over the layer.
- Enable Street Labels.
- Open the same map as in 1 and notice that the popup window no longer appears when you click the layer.
Expected behavior I expected that the existing popup window would not be affected by enabling Street Labels.
Screenshots
Screenshot showing the popup window
Screenshot showing Street Labels working
Desktop:
- OS: MacOS Ventura 13.1
- Browser: Safari 16.2
Additional context
My code (I've tried this with interactive
set to true
and with interactive
set to false):
var zoneClassRenderer = new L.StreetLabels({
collisionFlg: false,
propertyName: 'zone_class',
showLabelIf: function (layer) {
return typeof layer.properties.zone_class != "undefined";
},
interactive: true,
fontStyle: {
dynamicFontSize: false,
fontSize: 12,
fontSizeUnit: "px",
lineWidth: 4.0,
fillStyle: "black",
strokeStyle: "white",
},
});
update on the issue:
layer.bindTooltip()
works but layer.bindPopup()
still doesn't work.