Leaflet.streetlabels icon indicating copy to clipboard operation
Leaflet.streetlabels copied to clipboard

Enabling Street Labels on polygons disables existing popups

Open stevevance opened this issue 2 years ago • 1 comments

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:

  1. Open a map that has a Leaflet popup. Click the layer and the popup window appears over the layer.
  2. Enable Street Labels.
  3. 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 image

Screenshot showing Street Labels working image

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",
		},
	});

stevevance avatar Dec 27 '22 18:12 stevevance

update on the issue:

layer.bindTooltip() works but layer.bindPopup() still doesn't work.

stevevance avatar Mar 28 '23 05:03 stevevance