From 84ef5b4fd54bde19179665ca80c84b46114eb3b9 Mon Sep 17 00:00:00 2001 From: Toni Martinez Date: Thu, 19 Jan 2017 11:13:27 +0100 Subject: [PATCH] Fix error with default icon image path when leaflet-map component is not imported in the DOM and is imported through the Shadow Dom of a component --- leaflet-core.html | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/leaflet-core.html b/leaflet-core.html index 630a9b8..5d24321 100644 --- a/leaflet-core.html +++ b/leaflet-core.html @@ -635,21 +635,7 @@ if (L.Icon.Default.imagePath) { return; } - - var scripts = document.getElementsByTagName('link'), - leafletRe = /[\/^]leaflet-map.html$/; - - var i, len, src, matches, path; - - for (i = 0, len = scripts.length; i < len; i++) { - src = scripts[i].href; - matches = src.match(leafletRe); - - if (matches) { - path = src.split(leafletRe)[0]; - L.Icon.Default.imagePath = (path ? path + '/' : '') + '../leaflet/dist/images'; - } - } + L.Icon.Default.imagePath = this.resolveUrl('../leaflet/dist/images'); }, domReady: function() {