leaflet-html 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,19 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - name: Checkout repository
12
- uses: actions/checkout@v2
12
+ uses: actions/checkout@v4
13
+ - name: Set Node.js
14
+ uses: actions/setup-node@v4
15
+ with:
16
+ node-version: 21
17
+ - name: Install
18
+ uses: borales/actions-yarn@v4
19
+ with:
20
+ cmd: install
21
+ - name: Build
22
+ uses: borales/actions-yarn@v4
23
+ with:
24
+ cmd: build
13
25
  - name: Publish if version has been updated
14
26
  uses: pascalgn/npm-publish-action@1.3.9
15
27
  with:
@@ -0,0 +1,2 @@
1
+ var a=function(a){return"[data-"+a+"]"},t=function(a){var t=a.dataset,e=t.attribution,r=t.maxZoom,o=t.minZoom,n=t.subdomains;return[a.dataset.urlTemplate,{attribution:void 0===e?null:e,maxZoom:void 0===r?"18":r,minZoom:void 0===o?"0":o,subdomains:void 0===n?"abc":n}]},e=function(a){var t=a.dataset.bounds;if(void 0===t)throw Error("data-bounds not specified");return[JSON.parse(t)]},r=void document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(a("leaflet-html")).forEach(function(r){var o=r.dataset,n=o.center,l=o.zoom,d=L.map(r).setView(JSON.parse(n),parseInt(l));r.querySelectorAll(a("lat-lng-bounds")).forEach(function(a){var t,r=(t=L).latLngBounds.apply(t,e(a));new MutationObserver(function(a){a.forEach(function(a){var t=e(a.target);d.flyToBounds(t[0])})}).observe(a,{attributes:!0,attributeFilter:["data-bounds"]}),d.fitBounds(r)}),r.querySelectorAll(a("tile-layer")).forEach(function(a){var e;(e=L).tileLayer.apply(e,t(a)).addTo(d)}),r.querySelectorAll(a("image-overlay")).forEach(function(a){var t;(t=L).imageOverlay.apply(t,function(a){var t=a.dataset,e=t.bounds;return[t.url,e=JSON.parse(e),{opacity:parseFloat(a.dataset.opacity)}]}(a)).addTo(d)}),r.querySelectorAll(a("video-overlay")).forEach(function(a){var t;(t=L).videoOverlay.apply(t,function(a){var t=a.dataset,e=t.url,r=t.bounds;e=JSON.parse(e),r=JSON.parse(r);var o=a.dataset,n=o.errorOverlayUrl,l=o.autoplay,d=void 0===l||l,i=o.muted,u=void 0===i||i,s=o.playsInline,c=void 0===s||s;return[e,r,{opacity:parseFloat(o.opacity),errorOverlayUrl:n,autoplay:d,muted:u,playsInline:c}]}(a)).addTo(d)}),r.querySelectorAll(a("control-layers")).forEach(function(e){var r={};e.querySelectorAll(a("tile-layer")).forEach(function(a){var e,o=a.dataset,n=o.name,l=o.show;r[n]=(e=L).tileLayer.apply(e,t(a)),null!=l&&r[n].addTo(d)});var o={};e.querySelectorAll(a("layer-group")).forEach(function(t){var e=t.dataset.name,r=[];new MutationObserver(function(a){var t=o[e];a.forEach(function(a){a.addedNodes.forEach(function(a){var e=L.marker(JSON.parse(a.dataset.latLng));t.addLayer(e),d.addLayer(e)}),a.removedNodes.forEach(function(a){var e=t.getLayer(a.dataset._leafletId);t.removeLayer(e),d.removeLayer(e)})})}).observe(t,{childList:!0}),t.querySelectorAll(a("marker")).forEach(function(t){var e=t.dataset.latLng,o=t.dataset.opacity,n={opacity:parseFloat(void 0===o?"1.0":o)},l=L.marker(JSON.parse(e),n).addTo(d);t.dataset._leafletId=L.stamp(l),new MutationObserver(function(a){a.forEach(function(a){l.setLatLng(JSON.parse(a.target.dataset.latLng))})}).observe(t,{attributes:!0,attributeFilter:["data-lat-lng"]}),t.querySelectorAll(a("popup")).forEach(function(a){l.bindPopup(a.dataset.content),new MutationObserver(function(){l.getPopup().setContent(a.dataset.content)}).observe(a,{attributes:!0,attributeFilter:["data-content"]})}),r.push(l)}),o[e]=L.layerGroup(r)}),L.control.layers(r,o).addTo(d)})})});module.exports=r;
2
+ //# sourceMappingURL=leaflet-html.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaflet-html.cjs","sources":["../src/index.js"],"sourcesContent":["// @ts-check\n\n// Helpers\nconst selector = (noun) => `[data-${noun}]`;\n\n/**\n * Parse L.tileLayer args from element attributes\n */\nconst parseTileLayer = (el) => {\n const { urlTemplate } = el.dataset;\n const {\n attribution = null,\n maxZoom = \"18\",\n minZoom = \"0\",\n subdomains = \"abc\",\n } = el.dataset;\n const options = { attribution, maxZoom, minZoom, subdomains };\n return [urlTemplate, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseImageOverlay = (el) => {\n let { url, bounds } = el.dataset;\n bounds = JSON.parse(bounds);\n const { opacity } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n return [url, bounds, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseVideoOverlay = (el) => {\n let { url, bounds } = el.dataset;\n url = JSON.parse(url);\n bounds = JSON.parse(bounds);\n const {\n opacity,\n errorOverlayUrl,\n autoplay = true,\n muted = true,\n playsInline = true,\n } = el.dataset;\n const options = {\n opacity: parseFloat(opacity),\n errorOverlayUrl,\n autoplay,\n muted,\n playsInline,\n };\n return [url, bounds, options];\n};\n\n/**\n * @param {HTMLElement} el\n */\nconst parseLatLngBounds = (el) => {\n let { bounds } = el.dataset;\n if (typeof bounds === \"undefined\") {\n throw Error(\"data-bounds not specified\")\n }\n return [JSON.parse(bounds)];\n}\n\nconst render = () => {\n // Render Leaflet API calls\n document.querySelectorAll(selector(\"leaflet-html\")).forEach((el) => {\n const { center, zoom } = el.dataset;\n const map = L.map(el).setView(JSON.parse(center), parseInt(zoom));\n\n // L.latLngBounds\n el.querySelectorAll(selector(\"lat-lng-bounds\")).forEach((el) => {\n const bounds = L.latLngBounds(...parseLatLngBounds(el))\n // TODO: encapsulate this design pattern\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n let [bounds] = parseLatLngBounds(mutation.target)\n map.flyToBounds(bounds); // TODO: Use HTML attrs for fly/fit bounds\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-bounds\"],\n });\n map.fitBounds(bounds)\n })\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n L.tileLayer(...parseTileLayer(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"image-overlay\")).forEach((el) => {\n L.imageOverlay(...parseImageOverlay(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"video-overlay\")).forEach((el) => {\n L.videoOverlay(...parseVideoOverlay(el)).addTo(map);\n });\n\n // L.control.layers\n el.querySelectorAll(selector(\"control-layers\")).forEach((el) => {\n const baseMaps = {};\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n const { name, show } = el.dataset;\n baseMaps[name] = L.tileLayer(...parseTileLayer(el));\n if (show != null) {\n baseMaps[name].addTo(map);\n }\n });\n\n const overlayMaps = {};\n // L.layerGroup\n el.querySelectorAll(selector(\"layer-group\")).forEach((el) => {\n const { name } = el.dataset;\n const layers = [];\n\n const observer = new MutationObserver(function (mutations) {\n const group = overlayMaps[name];\n\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n const { latLng } = node.dataset; // MutationObserver needed\n const layer = L.marker(JSON.parse(latLng));\n group.addLayer(layer);\n map.addLayer(layer);\n });\n\n mutation.removedNodes.forEach((node) => {\n const { _leafletId } = node.dataset;\n const layer = group.getLayer(_leafletId);\n group.removeLayer(layer);\n\n map.removeLayer(layer);\n });\n });\n });\n observer.observe(el, { childList: true });\n\n // L.marker\n el.querySelectorAll(selector(\"marker\")).forEach((el) => {\n const { latLng } = el.dataset;\n const { opacity = \"1.0\" } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n const marker = L.marker(JSON.parse(latLng), options).addTo(map);\n el.dataset._leafletId = L.stamp(marker); // Save ID for later\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n const { latLng } = mutation.target.dataset;\n marker.setLatLng(JSON.parse(latLng));\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-lat-lng\"],\n });\n\n // marker.bindPopup\n el.querySelectorAll(selector(\"popup\")).forEach((el) => {\n const { content } = el.dataset;\n marker.bindPopup(content);\n const observer = new MutationObserver(function () {\n marker.getPopup().setContent(el.dataset.content);\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-content\"],\n });\n });\n\n layers.push(marker);\n });\n\n overlayMaps[name] = L.layerGroup(layers);\n });\n\n L.control.layers(baseMaps, overlayMaps).addTo(map);\n });\n });\n};\n\nconst init = (() => {\n document.addEventListener(\"DOMContentLoaded\", render);\n})();\n\nexport default init;\n"],"names":["selector","noun","parseTileLayer","el","_el$dataset","dataset","_el$dataset$attributi","attribution","_el$dataset$maxZoom","maxZoom","_el$dataset$minZoom","minZoom","_el$dataset$subdomain","subdomains","urlTemplate","parseLatLngBounds","bounds","Error","JSON","parse","init","document","addEventListener","querySelectorAll","forEach","_el$dataset5","center","zoom","map","L","setView","parseInt","_L","latLngBounds","apply","MutationObserver","mutations","mutation","_parseLatLngBounds","target","flyToBounds","observe","attributes","attributeFilter","fitBounds","_L2","tileLayer","addTo","_L3","imageOverlay","_el$dataset2","url","opacity","parseFloat","parseImageOverlay","_L4","videoOverlay","_el$dataset3","_el$dataset4","errorOverlayUrl","_el$dataset4$autoplay","autoplay","_el$dataset4$muted","muted","_el$dataset4$playsInl","playsInline","parseVideoOverlay","baseMaps","_L5","_el$dataset6","name","show","overlayMaps","layers","group","addedNodes","node","layer","marker","latLng","addLayer","removedNodes","getLayer","_leafletId","removeLayer","childList","_el$dataset$opacity","options","stamp","setLatLng","bindPopup","content","getPopup","setContent","push","layerGroup","control"],"mappings":"AAGA,IAAMA,EAAW,SAACC,GAAkBA,MAAAA,SAAAA,OAK9BC,EAAiB,SAACC,GACtB,IACAC,EAKID,EAAGE,QAAOC,EAAAF,EAJZG,YAAkBC,EAAAJ,EAClBK,QAAcC,EAAAN,EACdO,QAAaC,EAAAR,EACbS,WAGF,MAAO,CARiBV,EAAGE,QAAnBS,YAOQ,CAAEP,iBALL,IAAAD,EAAG,KAAIA,EAKWG,aAJnB,IA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GAAazB,MAAMnB,EAChD,EACF,EACF"}
@@ -0,0 +1,2 @@
1
+ var a=function(a){return"[data-"+a+"]"},t=function(a){var t=a.dataset,e=t.attribution,r=t.maxZoom,o=t.minZoom,n=t.subdomains;return[a.dataset.urlTemplate,{attribution:void 0===e?null:e,maxZoom:void 0===r?"18":r,minZoom:void 0===o?"0":o,subdomains:void 0===n?"abc":n}]},e=function(a){var t=a.dataset.bounds;if(void 0===t)throw Error("data-bounds not specified");return[JSON.parse(t)]},r=void document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(a("leaflet-html")).forEach(function(r){var o=r.dataset,n=o.center,l=o.zoom,d=L.map(r).setView(JSON.parse(n),parseInt(l));r.querySelectorAll(a("lat-lng-bounds")).forEach(function(a){var t,r=(t=L).latLngBounds.apply(t,e(a));new MutationObserver(function(a){a.forEach(function(a){var t=e(a.target);d.flyToBounds(t[0])})}).observe(a,{attributes:!0,attributeFilter:["data-bounds"]}),d.fitBounds(r)}),r.querySelectorAll(a("tile-layer")).forEach(function(a){var e;(e=L).tileLayer.apply(e,t(a)).addTo(d)}),r.querySelectorAll(a("image-overlay")).forEach(function(a){var t;(t=L).imageOverlay.apply(t,function(a){var t=a.dataset,e=t.bounds;return[t.url,e=JSON.parse(e),{opacity:parseFloat(a.dataset.opacity)}]}(a)).addTo(d)}),r.querySelectorAll(a("video-overlay")).forEach(function(a){var t;(t=L).videoOverlay.apply(t,function(a){var t=a.dataset,e=t.url,r=t.bounds;e=JSON.parse(e),r=JSON.parse(r);var o=a.dataset,n=o.errorOverlayUrl,l=o.autoplay,d=void 0===l||l,i=o.muted,u=void 0===i||i,s=o.playsInline,c=void 0===s||s;return[e,r,{opacity:parseFloat(o.opacity),errorOverlayUrl:n,autoplay:d,muted:u,playsInline:c}]}(a)).addTo(d)}),r.querySelectorAll(a("control-layers")).forEach(function(e){var r={};e.querySelectorAll(a("tile-layer")).forEach(function(a){var e,o=a.dataset,n=o.name,l=o.show;r[n]=(e=L).tileLayer.apply(e,t(a)),null!=l&&r[n].addTo(d)});var o={};e.querySelectorAll(a("layer-group")).forEach(function(t){var e=t.dataset.name,r=[];new MutationObserver(function(a){var t=o[e];a.forEach(function(a){a.addedNodes.forEach(function(a){var e=L.marker(JSON.parse(a.dataset.latLng));t.addLayer(e),d.addLayer(e)}),a.removedNodes.forEach(function(a){var e=t.getLayer(a.dataset._leafletId);t.removeLayer(e),d.removeLayer(e)})})}).observe(t,{childList:!0}),t.querySelectorAll(a("marker")).forEach(function(t){var e=t.dataset.latLng,o=t.dataset.opacity,n={opacity:parseFloat(void 0===o?"1.0":o)},l=L.marker(JSON.parse(e),n).addTo(d);t.dataset._leafletId=L.stamp(l),new MutationObserver(function(a){a.forEach(function(a){l.setLatLng(JSON.parse(a.target.dataset.latLng))})}).observe(t,{attributes:!0,attributeFilter:["data-lat-lng"]}),t.querySelectorAll(a("popup")).forEach(function(a){l.bindPopup(a.dataset.content),new MutationObserver(function(){l.getPopup().setContent(a.dataset.content)}).observe(a,{attributes:!0,attributeFilter:["data-content"]})}),r.push(l)}),o[e]=L.layerGroup(r)}),L.control.layers(r,o).addTo(d)})})});export{r as default};
2
+ //# sourceMappingURL=leaflet-html.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaflet-html.esm.js","sources":["../src/index.js"],"sourcesContent":["// @ts-check\n\n// Helpers\nconst selector = (noun) => `[data-${noun}]`;\n\n/**\n * Parse L.tileLayer args from element attributes\n */\nconst parseTileLayer = (el) => {\n const { urlTemplate } = el.dataset;\n const {\n attribution = null,\n maxZoom = \"18\",\n minZoom = \"0\",\n subdomains = \"abc\",\n } = el.dataset;\n const options = { attribution, maxZoom, minZoom, subdomains };\n return [urlTemplate, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseImageOverlay = (el) => {\n let { url, bounds } = el.dataset;\n bounds = JSON.parse(bounds);\n const { opacity } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n return [url, bounds, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseVideoOverlay = (el) => {\n let { url, bounds } = el.dataset;\n url = JSON.parse(url);\n bounds = JSON.parse(bounds);\n const {\n opacity,\n errorOverlayUrl,\n autoplay = true,\n muted = true,\n playsInline = true,\n } = el.dataset;\n const options = {\n opacity: parseFloat(opacity),\n errorOverlayUrl,\n autoplay,\n muted,\n playsInline,\n };\n return [url, bounds, options];\n};\n\n/**\n * @param {HTMLElement} el\n */\nconst parseLatLngBounds = (el) => {\n let { bounds } = el.dataset;\n if (typeof bounds === \"undefined\") {\n throw Error(\"data-bounds not specified\")\n }\n return [JSON.parse(bounds)];\n}\n\nconst render = () => {\n // Render Leaflet API calls\n document.querySelectorAll(selector(\"leaflet-html\")).forEach((el) => {\n const { center, zoom } = el.dataset;\n const map = L.map(el).setView(JSON.parse(center), parseInt(zoom));\n\n // L.latLngBounds\n el.querySelectorAll(selector(\"lat-lng-bounds\")).forEach((el) => {\n const bounds = L.latLngBounds(...parseLatLngBounds(el))\n // TODO: encapsulate this design pattern\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n let [bounds] = parseLatLngBounds(mutation.target)\n map.flyToBounds(bounds); // TODO: Use HTML attrs for fly/fit bounds\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-bounds\"],\n });\n map.fitBounds(bounds)\n })\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n L.tileLayer(...parseTileLayer(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"image-overlay\")).forEach((el) => {\n L.imageOverlay(...parseImageOverlay(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"video-overlay\")).forEach((el) => {\n L.videoOverlay(...parseVideoOverlay(el)).addTo(map);\n });\n\n // L.control.layers\n el.querySelectorAll(selector(\"control-layers\")).forEach((el) => {\n const baseMaps = {};\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n const { name, show } = el.dataset;\n baseMaps[name] = L.tileLayer(...parseTileLayer(el));\n if (show != null) {\n baseMaps[name].addTo(map);\n }\n });\n\n const overlayMaps = {};\n // L.layerGroup\n el.querySelectorAll(selector(\"layer-group\")).forEach((el) => {\n const { name } = el.dataset;\n const layers = [];\n\n const observer = new MutationObserver(function (mutations) {\n const group = overlayMaps[name];\n\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n const { latLng } = node.dataset; // MutationObserver needed\n const layer = L.marker(JSON.parse(latLng));\n group.addLayer(layer);\n map.addLayer(layer);\n });\n\n mutation.removedNodes.forEach((node) => {\n const { _leafletId } = node.dataset;\n const layer = group.getLayer(_leafletId);\n group.removeLayer(layer);\n\n map.removeLayer(layer);\n });\n });\n });\n observer.observe(el, { childList: true });\n\n // L.marker\n el.querySelectorAll(selector(\"marker\")).forEach((el) => {\n const { latLng } = el.dataset;\n const { opacity = \"1.0\" } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n const marker = L.marker(JSON.parse(latLng), options).addTo(map);\n el.dataset._leafletId = L.stamp(marker); // Save ID for later\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n const { latLng } = mutation.target.dataset;\n marker.setLatLng(JSON.parse(latLng));\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-lat-lng\"],\n });\n\n // marker.bindPopup\n el.querySelectorAll(selector(\"popup\")).forEach((el) => {\n const { content } = el.dataset;\n marker.bindPopup(content);\n const observer = new MutationObserver(function () {\n marker.getPopup().setContent(el.dataset.content);\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-content\"],\n });\n });\n\n layers.push(marker);\n });\n\n overlayMaps[name] = L.layerGroup(layers);\n });\n\n L.control.layers(baseMaps, overlayMaps).addTo(map);\n });\n });\n};\n\nconst init = (() => {\n document.addEventListener(\"DOMContentLoaded\", render);\n})();\n\nexport default init;\n"],"names":["selector","noun","parseTileLayer","el","_el$dataset","dataset","_el$dataset$attributi","attribution","_el$dataset$maxZoom","maxZoom","_el$dataset$minZoom","minZoom","_el$dataset$subdomain","subdomains","urlTemplate","parseLatLngBounds","bounds","Error","JSON","parse","init","document","addEventListener","querySelectorAll","forEach","_el$dataset5","center","zoom","map","L","setView","parseInt","_L","latLngBounds","apply","MutationObserver","mutations","mutation","_parseLatLngBounds","target","flyToBounds","observe","attributes","attributeFilter","fitBounds","_L2","tileLayer","addTo","_L3","imageOverlay","_el$dataset2","url","opacity","parseFloat","parseImageOverlay","_L4","videoOverlay","_el$dataset3","_el$dataset4","errorOverlayUrl","_el$dataset4$autoplay","autoplay","_el$dataset4$muted","muted","_el$dataset4$playsInl","playsInline","parseVideoOverlay","baseMaps","_L5","_el$dataset6","name","show","overlayMaps","layers","group","addedNodes","node","layer","marker","latLng","addLayer","removedNodes","getLayer","_leafletId","removeLayer","childList","_el$dataset$opacity","options","stamp","setLatLng","bindPopup","content","getPopup","setContent","push","layerGroup","control"],"mappings":"AAGA,IAAMA,EAAW,SAACC,GAAkBA,MAAAA,SAAAA,OAK9BC,EAAiB,SAACC,GACtB,IACAC,EAKID,EAAGE,QAAOC,EAAAF,EAJZG,YAAkBC,EAAAJ,EAClBK,QAAcC,EAAAN,EACdO,QAAaC,EAAAR,EACbS,WAGF,MAAO,CARiBV,EAAGE,QAAnBS,YAOQ,CAAEP,iBALL,IAAAD,EAAG,KAAIA,EAKWG,aAJnB,IAAHD,EAAG,KAAIA,EAIwBG,aAH/B,IAAAD,EAAG,IAAGA,EAGkCG,gBAFlC,IAAHD,EAAG,MAAKA,GAItB,EAwCMG,EAAoB,SAACZ,GACzB,IAAMa,EAAWb,EAAGE,QAAdW,OACN,QAAsB,IAAXA,EACT,MAAMC,MAAM,6BAEd,MAAO,CAACC,KAAKC,MAAMH,GACrB,EA0HMI,OACJC,SAASC,iBAAiB,mBAzHb,WAEbD,SAASE,iBAAiBvB,EAAS,iBAAiBwB,QAAQ,SAACrB,GAC3D,IAAAsB,EAAyBtB,EAAGE,QAApBqB,EAAMD,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EkF,WAAW,IAGlClF,EAAGoB,iBAAiBvB,EAAS,WAAWwB,QAAQ,SAACrB,GAC/C,IAAQ4E,EAAW5E,EAAGE,QAAd0E,OACRO,EAA4BnF,EAAGE,QAAvB+C,QACFmC,EAAU,CAAEnC,QAASC,gBADZ,IAAAiC,EAAG,MAAKA,IAEjBR,EAASjD,EAAEiD,OAAO5D,KAAKC,MAAM4D,GAASQ,GAASxC,MAAMnB,GAC3DzB,EAAGE,QAAQ8E,WAAatD,EAAE2D,MAAMV,GAEf,IAAI3C,iBAAiB,SAAUC,GAC9CA,EAAUZ,QAAQ,SAACa,GAEjByC,EAAOW,UAAUvE,KAAKC,MADHkB,EAASE,OAAOlC,QAA3B0E,QAEV,EACF,GACStC,QAAQtC,EAAI,CACnBuC,YAAY,EACZC,gBAAiB,CAAC,kBAIpBxC,EAAGoB,iBAAiBvB,EAAS,UAAUwB,QAAQ,SAACrB,GAE9C2E,EAAOY,UADavF,EAAGE,QAAfsF,SAES,IAAIxD,iBAAiB,WACpC2C,EAAOc,WAAWC,WAAW1F,EAAGE,QAAQsF,QAC1C,GACSlD,QAAQtC,EAAI,CACnBuC,YAAY,EACZC,gBAAiB,CAAC,iBAEtB,GAEA8B,EAAOqB,KAAKhB,EACd,GAEAN,EAAYF,GAAQzC,EAAEkE,WAAWtB,EACnC,GAEA5C,EAAEmE,QAAQvB,OAAON,EAAUK,GAAazB,MAAMnB,EAChD,EACF,EACF"}
@@ -0,0 +1,2 @@
1
+ const t=t=>`[data-${t}]`,e=t=>{const{urlTemplate:e}=t.dataset,{attribution:a=null,maxZoom:o="18",minZoom:r="0",subdomains:l="abc"}=t.dataset;return[e,{attribution:a,maxZoom:o,minZoom:r,subdomains:l}]},a=t=>{let{bounds:e}=t.dataset;if(void 0===e)throw Error("data-bounds not specified");return[JSON.parse(e)]},o=void document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(t("leaflet-html")).forEach(o=>{const{center:r,zoom:l}=o.dataset,n=L.map(o).setView(JSON.parse(r),parseInt(l));o.querySelectorAll(t("lat-lng-bounds")).forEach(t=>{const e=L.latLngBounds(...a(t)),o=new MutationObserver(function(t){t.forEach(t=>{let[e]=a(t.target);n.flyToBounds(e)})});o.observe(t,{attributes:!0,attributeFilter:["data-bounds"]}),n.fitBounds(e)}),o.querySelectorAll(t("tile-layer")).forEach(t=>{L.tileLayer(...e(t)).addTo(n)}),o.querySelectorAll(t("image-overlay")).forEach(t=>{L.imageOverlay(...(t=>{let{url:e,bounds:a}=t.dataset;a=JSON.parse(a);const{opacity:o}=t.dataset;return[e,a,{opacity:parseFloat(o)}]})(t)).addTo(n)}),o.querySelectorAll(t("video-overlay")).forEach(t=>{L.videoOverlay(...(t=>{let{url:e,bounds:a}=t.dataset;e=JSON.parse(e),a=JSON.parse(a);const{opacity:o,errorOverlayUrl:r,autoplay:l=!0,muted:n=!0,playsInline:s=!0}=t.dataset;return[e,a,{opacity:parseFloat(o),errorOverlayUrl:r,autoplay:l,muted:n,playsInline:s}]})(t)).addTo(n)}),o.querySelectorAll(t("control-layers")).forEach(a=>{const o={};a.querySelectorAll(t("tile-layer")).forEach(t=>{const{name:a,show:r}=t.dataset;o[a]=L.tileLayer(...e(t)),null!=r&&o[a].addTo(n)});const r={};a.querySelectorAll(t("layer-group")).forEach(e=>{const{name:a}=e.dataset,o=[];new MutationObserver(function(t){const e=r[a];t.forEach(t=>{t.addedNodes.forEach(t=>{const{latLng:a}=t.dataset,o=L.marker(JSON.parse(a));e.addLayer(o),n.addLayer(o)}),t.removedNodes.forEach(t=>{const{_leafletId:a}=t.dataset,o=e.getLayer(a);e.removeLayer(o),n.removeLayer(o)})})}).observe(e,{childList:!0}),e.querySelectorAll(t("marker")).forEach(e=>{const{latLng:a}=e.dataset,{opacity:r="1.0"}=e.dataset,l={opacity:parseFloat(r)},s=L.marker(JSON.parse(a),l).addTo(n);e.dataset._leafletId=L.stamp(s);const d=new MutationObserver(function(t){t.forEach(t=>{const{latLng:e}=t.target.dataset;s.setLatLng(JSON.parse(e))})});d.observe(e,{attributes:!0,attributeFilter:["data-lat-lng"]}),e.querySelectorAll(t("popup")).forEach(t=>{const{content:e}=t.dataset;s.bindPopup(e),new MutationObserver(function(){s.getPopup().setContent(t.dataset.content)}).observe(t,{attributes:!0,attributeFilter:["data-content"]})}),o.push(s)}),r[a]=L.layerGroup(o)}),L.control.layers(o,r).addTo(n)})})});export{o as default};
2
+ //# sourceMappingURL=leaflet-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaflet-html.js","sources":["../src/index.js"],"sourcesContent":["// @ts-check\n\n// Helpers\nconst selector = (noun) => `[data-${noun}]`;\n\n/**\n * Parse L.tileLayer args from element attributes\n */\nconst parseTileLayer = (el) => {\n const { urlTemplate } = el.dataset;\n const {\n attribution = null,\n maxZoom = \"18\",\n minZoom = \"0\",\n subdomains = \"abc\",\n } = el.dataset;\n const options = { attribution, maxZoom, minZoom, subdomains };\n return [urlTemplate, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseImageOverlay = (el) => {\n let { url, bounds } = el.dataset;\n bounds = JSON.parse(bounds);\n const { opacity } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n return [url, bounds, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseVideoOverlay = (el) => {\n let { url, bounds } = el.dataset;\n url = JSON.parse(url);\n bounds = JSON.parse(bounds);\n const {\n opacity,\n errorOverlayUrl,\n autoplay = true,\n muted = true,\n playsInline = true,\n } = el.dataset;\n const options = {\n opacity: parseFloat(opacity),\n errorOverlayUrl,\n autoplay,\n muted,\n playsInline,\n };\n return [url, bounds, options];\n};\n\n/**\n * @param {HTMLElement} el\n */\nconst parseLatLngBounds = (el) => {\n let { bounds } = el.dataset;\n if (typeof bounds === \"undefined\") {\n throw Error(\"data-bounds not specified\")\n }\n return [JSON.parse(bounds)];\n}\n\nconst render = () => {\n // Render Leaflet API calls\n document.querySelectorAll(selector(\"leaflet-html\")).forEach((el) => {\n const { center, zoom } = el.dataset;\n const map = L.map(el).setView(JSON.parse(center), parseInt(zoom));\n\n // L.latLngBounds\n el.querySelectorAll(selector(\"lat-lng-bounds\")).forEach((el) => {\n const bounds = L.latLngBounds(...parseLatLngBounds(el))\n // TODO: encapsulate this design pattern\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n let [bounds] = parseLatLngBounds(mutation.target)\n map.flyToBounds(bounds); // TODO: Use HTML attrs for fly/fit bounds\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-bounds\"],\n });\n map.fitBounds(bounds)\n })\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n L.tileLayer(...parseTileLayer(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"image-overlay\")).forEach((el) => {\n L.imageOverlay(...parseImageOverlay(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"video-overlay\")).forEach((el) => {\n L.videoOverlay(...parseVideoOverlay(el)).addTo(map);\n });\n\n // L.control.layers\n el.querySelectorAll(selector(\"control-layers\")).forEach((el) => {\n const baseMaps = {};\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n const { name, show } = el.dataset;\n baseMaps[name] = L.tileLayer(...parseTileLayer(el));\n if (show != null) {\n baseMaps[name].addTo(map);\n }\n });\n\n const overlayMaps = {};\n // L.layerGroup\n el.querySelectorAll(selector(\"layer-group\")).forEach((el) => {\n const { name } = el.dataset;\n const layers = [];\n\n const observer = new MutationObserver(function (mutations) {\n const group = overlayMaps[name];\n\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n const { latLng } = node.dataset; // MutationObserver needed\n const layer = L.marker(JSON.parse(latLng));\n group.addLayer(layer);\n map.addLayer(layer);\n });\n\n mutation.removedNodes.forEach((node) => {\n const { _leafletId } = node.dataset;\n const layer = group.getLayer(_leafletId);\n group.removeLayer(layer);\n\n map.removeLayer(layer);\n });\n });\n });\n observer.observe(el, { childList: true });\n\n // L.marker\n el.querySelectorAll(selector(\"marker\")).forEach((el) => {\n const { latLng } = el.dataset;\n const { opacity = \"1.0\" } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n const marker = L.marker(JSON.parse(latLng), options).addTo(map);\n el.dataset._leafletId = L.stamp(marker); // Save ID for later\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n const { latLng } = mutation.target.dataset;\n marker.setLatLng(JSON.parse(latLng));\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-lat-lng\"],\n });\n\n // marker.bindPopup\n el.querySelectorAll(selector(\"popup\")).forEach((el) => {\n const { content } = el.dataset;\n marker.bindPopup(content);\n const observer = new MutationObserver(function () {\n marker.getPopup().setContent(el.dataset.content);\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-content\"],\n });\n });\n\n layers.push(marker);\n });\n\n overlayMaps[name] = L.layerGroup(layers);\n });\n\n L.control.layers(baseMaps, overlayMaps).addTo(map);\n });\n });\n};\n\nconst init = (() => {\n document.addEventListener(\"DOMContentLoaded\", render);\n})();\n\nexport default init;\n"],"names":["selector","noun","parseTileLayer","el","urlTemplate","dataset","attribution","maxZoom","minZoom","subdomains","parseLatLngBounds","bounds","Error","JSON","parse","init","document","addEventListener","render","querySelectorAll","forEach","center","zoom","map","L","setView","parseInt","latLngBounds","observer","MutationObserver","mutations","mutation","target","flyToBounds","observe","attributes","attributeFilter","fitBounds","tileLayer","addTo","imageOverlay","url","opacity","parseFloat","parseImageOverlay","videoOverlay","errorOverlayUrl","autoplay","muted","playsInline","parseVideoOverlay","baseMaps","name","show","overlayMaps","layers","group","addedNodes","node","latLng","layer","marker","addLayer","removedNodes","_leafletId","getLayer","removeLayer","childList","options","stamp","setLatLng","content","bindPopup","getPopup","setContent","push","layerGroup","control"],"mappings":"AAGA,MAAMA,EAAYC,GAAU,SAAQA,KAK9BC,EAAkBC,IACtB,MAAMC,YAAEA,GAAgBD,EAAGE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EAEL,GACS1B,QAAQ/B,EAAI,CAAEgE,WAAW,IAGlChE,EAAGgB,iBAAiBnB,EAAS,WAAWoB,QAASjB,IAC/C,MAAMwD,OAAEA,GAAWxD,EAAGE,SAChBqC,QAAEA,EAAU,OAAUvC,EAAGE,QACzB+D,EAAU,CAAE1B,QAASC,WAAWD,IAChCmB,EAASrC,EAAEqC,OAAOhD,KAAKC,MAAM6C,GAASS,GAAS7B,MAAMhB,GAC3DpB,EAAGE,QAAQ2D,WAAaxC,EAAE6C,MAAMR,GAEhC,MAAMjC,EAAW,IAAIC,iBAAiB,SAAUC,GAC9CA,EAAUV,QAASW,IACjB,MAAM4B,OAAEA,GAAW5B,EAASC,OAAO3B,QACnCwD,EAAOS,UAAUzD,KAAKC,MAAM6C,GAC9B,EACF,GACA/B,EAASM,QAAQ/B,EAAI,CACnBgC,YAAY,EACZC,gBAAiB,CAAC,kBAIpBjC,EAAGgB,iBAAiBnB,EAAS,UAAUoB,QAASjB,IAC9C,MAAMoE,QAAEA,GAAYpE,EAAGE,QACvBwD,EAAOW,UAAUD,GACA,IAAI1C,iBAAiB,WACpCgC,EAAOY,WAAWC,WAAWvE,EAAGE,QAAQkE,QAC1C,GACSrC,QAAQ/B,EAAI,CACnBgC,YAAY,EACZC,gBAAiB,CAAC,iBACnB,GAGHmB,EAAOoB,KAAKd,EACd,GAEAP,EAAYF,GAAQ5B,EAAEoD,WAAWrB,EACnC,GAEA/B,EAAEqD,QAAQtB,OAAOJ,EAAUG,GAAaf,MAAMhB,EAChD,EACF,EACF"}
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).leafletHtml=t()}(this,function(){var e=function(e){return"[data-"+e+"]"},t=function(e){var t=e.dataset,a=t.attribution,o=t.maxZoom,r=t.minZoom,n=t.subdomains;return[e.dataset.urlTemplate,{attribution:void 0===a?null:a,maxZoom:void 0===o?"18":o,minZoom:void 0===r?"0":r,subdomains:void 0===n?"abc":n}]},a=function(e){var t=e.dataset.bounds;if(void 0===t)throw Error("data-bounds not specified");return[JSON.parse(t)]};document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(e("leaflet-html")).forEach(function(o){var r=o.dataset,n=r.center,l=r.zoom,i=L.map(o).setView(JSON.parse(n),parseInt(l));o.querySelectorAll(e("lat-lng-bounds")).forEach(function(e){var t,o=(t=L).latLngBounds.apply(t,a(e));new MutationObserver(function(e){e.forEach(function(e){var t=a(e.target);i.flyToBounds(t[0])})}).observe(e,{attributes:!0,attributeFilter:["data-bounds"]}),i.fitBounds(o)}),o.querySelectorAll(e("tile-layer")).forEach(function(e){var a;(a=L).tileLayer.apply(a,t(e)).addTo(i)}),o.querySelectorAll(e("image-overlay")).forEach(function(e){var t;(t=L).imageOverlay.apply(t,function(e){var t=e.dataset,a=t.bounds;return[t.url,a=JSON.parse(a),{opacity:parseFloat(e.dataset.opacity)}]}(e)).addTo(i)}),o.querySelectorAll(e("video-overlay")).forEach(function(e){var t;(t=L).videoOverlay.apply(t,function(e){var t=e.dataset,a=t.url,o=t.bounds;a=JSON.parse(a),o=JSON.parse(o);var r=e.dataset,n=r.errorOverlayUrl,l=r.autoplay,i=void 0===l||l,d=r.muted,u=void 0===d||d,s=r.playsInline,c=void 0===s||s;return[a,o,{opacity:parseFloat(r.opacity),errorOverlayUrl:n,autoplay:i,muted:u,playsInline:c}]}(e)).addTo(i)}),o.querySelectorAll(e("control-layers")).forEach(function(a){var o={};a.querySelectorAll(e("tile-layer")).forEach(function(e){var a,r=e.dataset,n=r.name,l=r.show;o[n]=(a=L).tileLayer.apply(a,t(e)),null!=l&&o[n].addTo(i)});var r={};a.querySelectorAll(e("layer-group")).forEach(function(t){var a=t.dataset.name,o=[];new MutationObserver(function(e){var t=r[a];e.forEach(function(e){e.addedNodes.forEach(function(e){var a=L.marker(JSON.parse(e.dataset.latLng));t.addLayer(a),i.addLayer(a)}),e.removedNodes.forEach(function(e){var a=t.getLayer(e.dataset._leafletId);t.removeLayer(a),i.removeLayer(a)})})}).observe(t,{childList:!0}),t.querySelectorAll(e("marker")).forEach(function(t){var a=t.dataset.latLng,r=t.dataset.opacity,n={opacity:parseFloat(void 0===r?"1.0":r)},l=L.marker(JSON.parse(a),n).addTo(i);t.dataset._leafletId=L.stamp(l),new MutationObserver(function(e){e.forEach(function(e){l.setLatLng(JSON.parse(e.target.dataset.latLng))})}).observe(t,{attributes:!0,attributeFilter:["data-lat-lng"]}),t.querySelectorAll(e("popup")).forEach(function(e){l.bindPopup(e.dataset.content),new MutationObserver(function(){l.getPopup().setContent(e.dataset.content)}).observe(e,{attributes:!0,attributeFilter:["data-content"]})}),o.push(l)}),r[a]=L.layerGroup(o)}),L.control.layers(o,r).addTo(i)})})})});
2
+ //# sourceMappingURL=leaflet-html.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaflet-html.umd.js","sources":["../src/index.js"],"sourcesContent":["// @ts-check\n\n// Helpers\nconst selector = (noun) => `[data-${noun}]`;\n\n/**\n * Parse L.tileLayer args from element attributes\n */\nconst parseTileLayer = (el) => {\n const { urlTemplate } = el.dataset;\n const {\n attribution = null,\n maxZoom = \"18\",\n minZoom = \"0\",\n subdomains = \"abc\",\n } = el.dataset;\n const options = { attribution, maxZoom, minZoom, subdomains };\n return [urlTemplate, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseImageOverlay = (el) => {\n let { url, bounds } = el.dataset;\n bounds = JSON.parse(bounds);\n const { opacity } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n return [url, bounds, options];\n};\n\n/**\n * Parse L.imageOverlay args from element attributes\n */\nconst parseVideoOverlay = (el) => {\n let { url, bounds } = el.dataset;\n url = JSON.parse(url);\n bounds = JSON.parse(bounds);\n const {\n opacity,\n errorOverlayUrl,\n autoplay = true,\n muted = true,\n playsInline = true,\n } = el.dataset;\n const options = {\n opacity: parseFloat(opacity),\n errorOverlayUrl,\n autoplay,\n muted,\n playsInline,\n };\n return [url, bounds, options];\n};\n\n/**\n * @param {HTMLElement} el\n */\nconst parseLatLngBounds = (el) => {\n let { bounds } = el.dataset;\n if (typeof bounds === \"undefined\") {\n throw Error(\"data-bounds not specified\")\n }\n return [JSON.parse(bounds)];\n}\n\nconst render = () => {\n // Render Leaflet API calls\n document.querySelectorAll(selector(\"leaflet-html\")).forEach((el) => {\n const { center, zoom } = el.dataset;\n const map = L.map(el).setView(JSON.parse(center), parseInt(zoom));\n\n // L.latLngBounds\n el.querySelectorAll(selector(\"lat-lng-bounds\")).forEach((el) => {\n const bounds = L.latLngBounds(...parseLatLngBounds(el))\n // TODO: encapsulate this design pattern\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n let [bounds] = parseLatLngBounds(mutation.target)\n map.flyToBounds(bounds); // TODO: Use HTML attrs for fly/fit bounds\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-bounds\"],\n });\n map.fitBounds(bounds)\n })\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n L.tileLayer(...parseTileLayer(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"image-overlay\")).forEach((el) => {\n L.imageOverlay(...parseImageOverlay(el)).addTo(map);\n });\n\n el.querySelectorAll(selector(\"video-overlay\")).forEach((el) => {\n L.videoOverlay(...parseVideoOverlay(el)).addTo(map);\n });\n\n // L.control.layers\n el.querySelectorAll(selector(\"control-layers\")).forEach((el) => {\n const baseMaps = {};\n\n // L.tileLayers\n el.querySelectorAll(selector(\"tile-layer\")).forEach((el) => {\n const { name, show } = el.dataset;\n baseMaps[name] = L.tileLayer(...parseTileLayer(el));\n if (show != null) {\n baseMaps[name].addTo(map);\n }\n });\n\n const overlayMaps = {};\n // L.layerGroup\n el.querySelectorAll(selector(\"layer-group\")).forEach((el) => {\n const { name } = el.dataset;\n const layers = [];\n\n const observer = new MutationObserver(function (mutations) {\n const group = overlayMaps[name];\n\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n const { latLng } = node.dataset; // MutationObserver needed\n const layer = L.marker(JSON.parse(latLng));\n group.addLayer(layer);\n map.addLayer(layer);\n });\n\n mutation.removedNodes.forEach((node) => {\n const { _leafletId } = node.dataset;\n const layer = group.getLayer(_leafletId);\n group.removeLayer(layer);\n\n map.removeLayer(layer);\n });\n });\n });\n observer.observe(el, { childList: true });\n\n // L.marker\n el.querySelectorAll(selector(\"marker\")).forEach((el) => {\n const { latLng } = el.dataset;\n const { opacity = \"1.0\" } = el.dataset;\n const options = { opacity: parseFloat(opacity) };\n const marker = L.marker(JSON.parse(latLng), options).addTo(map);\n el.dataset._leafletId = L.stamp(marker); // Save ID for later\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n const { latLng } = mutation.target.dataset;\n marker.setLatLng(JSON.parse(latLng));\n });\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-lat-lng\"],\n });\n\n // marker.bindPopup\n el.querySelectorAll(selector(\"popup\")).forEach((el) => {\n const { content } = el.dataset;\n marker.bindPopup(content);\n const observer = new MutationObserver(function () {\n marker.getPopup().setContent(el.dataset.content);\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: [\"data-content\"],\n });\n });\n\n layers.push(marker);\n });\n\n overlayMaps[name] = L.layerGroup(layers);\n });\n\n L.control.layers(baseMaps, overlayMaps).addTo(map);\n });\n });\n};\n\nconst init = (() => {\n document.addEventListener(\"DOMContentLoaded\", render);\n})();\n\nexport default init;\n"],"names":["selector","noun","parseTileLayer","el","_el$dataset","dataset","_el$dataset$attributi","attribution","_el$dataset$maxZoom","maxZoom","_el$dataset$minZoom","minZoom","_el$dataset$subdomain","subdomains","urlTemplate","parseLatLngBounds","bounds","Error","JSON","parse","document","addEventListener","querySelectorAll","forEach","_el$dataset5","center","zoom","map","L","setView","parseInt","_L","latLngBounds","apply","MutationObserver","mutations","mutation","_parseLatLngBounds","target","flyToBounds","observe","attributes","attributeFilter","fitBounds","_L2","tileLayer","addTo","_L3","imageOverlay","_el$dataset2","url","opacity","parseFloat","parseImageOverlay","_L4","videoOverlay","_el$dataset3","_el$dataset4","errorOverlayUrl","_el$dataset4$autoplay","autoplay","_el$dataset4$muted","muted","_el$dataset4$playsInl","playsInline","parseVideoOverlay","baseMaps","_L5","_el$dataset6","name","show","overlayMaps","layers","group","addedNodes","node","layer","marker","latLng","addLayer","removedNodes","getLayer","_leafletId","removeLayer","childList","_el$dataset$opacity","options","stamp","setLatLng","bindPopup","content","getPopup","setContent","push","layerGroup","control"],"mappings":"8NAGA,IAAMA,EAAW,SAACC,GAAkBA,MAAAA,SAAAA,OAK9BC,EAAiB,SAACC,GACtB,IACAC,EAKID,EAAGE,QAAOC,EAAAF,EAJZG,YAAkBC,EAAAJ,EAClBK,QAAcC,EAAAN,EACdO,QAAaC,EAAAR,EACbS,WAGF,MAAO,CARiBV,EAAGE,QAAnBS,YAOQ,CAAEP,iBALL,IAAAD,EAAG,KAAIA,EAKWG,aAJnB,IAAHD,EAAG,KAAIA,EAIwBG,aAH/B,IAAAD,EAAG,IAAGA,EAGkCG,gBAFlC,IAAHD,EAAG,MAAKA,GAItB,EAwCMG,EAAoB,SAACZ,GACzB,IAAMa,EAAWb,EAAGE,QAAdW,OACN,QAAsB,IAAXA,EACT,MAAMC,MAAM,6BAEd,MAAO,CAACC,KAAKC,MAAMH,GACrB,EA2HEI,SAASC,iBAAiB,mBAzHb,WAEbD,SAASE,iBAAiBtB,EAAS,iBAAiBuB,QAAQ,SAACpB,GAC3D,IAAAqB,EAAyBrB,EAAGE,QAApBoB,EAAMD,EAANC,OAAQC,EAAIF,EAAJE,KACVC,EAAMC,EAAED,IAAIxB,GAAI0B,QAAQX,KAAKC,MAAMM,GAASK,SAASJ,IAG3DvB,EAAGmB,iBAAiBtB,EAAS,mBAAmBuB,QAAQ,SAACpB,GAAO,IAAA4B,EACxDf,GAASe,EAAAH,GAAEI,aAAYC,MAAAF,EAAIhB,EAAkBZ,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,MAAM2D,GAASQ,GAASxC,MAAMnB,GAC3DxB,EAAGE,QAAQ6E,WAAatD,EAAE2D,MAAMV,GAEf,IAAI3C,iBAAiB,SAAUC,GAC9CA,EAAUZ,QAAQ,SAACa,GAEjByC,EAAOW,UAAUtE,KAAKC,MADHiB,EAASE,OAAOjC,QAA3ByE,QAEV,EACF,GACStC,QAAQrC,EAAI,CACnBsC,YAAY,EACZC,gBAAiB,CAAC,kBAIpBvC,EAAGmB,iBAAiBtB,EAAS,UAAUuB,QAAQ,SAACpB,GAE9C0E,EAAOY,UADatF,EAAGE,QAAfqF,SAES,IAAIxD,iBAAiB,WACpC2C,EAAOc,WAAWC,WAAWzF,EAAGE,QAAQqF,QAC1C,GACSlD,QAAQrC,EAAI,CACnBsC,YAAY,EACZC,gBAAiB,CAAC,iBAEtB,GAEA8B,EAAOqB,KAAKhB,EACd,GAEAN,EAAYF,GAAQzC,EAAEkE,WAAWtB,EACnC,GAEA5C,EAAEmE,QAAQvB,OAAON,EAAUK,GAAazB,MAAMnB,EAChD,EACF,EACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "leaflet-html",
3
3
  "type": "module",
4
- "version": "0.1.6",
4
+ "version": "0.1.7",
5
5
  "description": "Leaflet expressed in HTML",
6
6
  "source": "src/index.js",
7
7
  "main": "./dist/leaflet-html.js",