From 4c5f7f9a85cc1f6df248ac16c3e82bf27fe09786 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 20 Apr 2020 18:00:37 +0200 Subject: [PATCH] Do not show label on path for polygons --- htdocs/leafletjs/Leaflet.streetlabels.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/leafletjs/Leaflet.streetlabels.js b/htdocs/leafletjs/Leaflet.streetlabels.js index 1fb2754..724c585 100644 --- a/htdocs/leafletjs/Leaflet.streetlabels.js +++ b/htdocs/leafletjs/Leaflet.streetlabels.js @@ -117,8 +117,7 @@ L.StreetLabels = L.LabelTextCollision var textLength = ctx.measureText(layerText).width; ctx.strokeText(layerText, p.x + offsetX - textLength / 2, p.y + offsetY); ctx.fillText(layerText, p.x + offsetX - textLength / 2, p.y + offsetY); - } - if (layer instanceof L.Polyline) { + } else if (layer instanceof L.Polyline) { /** * Render text alongside the polyline * **/