leaflet-html 0.9.3 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/leaflet-html.js +1 -1
- package/dist/leaflet-html.js.map +1 -1
- package/package.json +1 -1
- package/dist/leaflet-html.cjs +0 -2
- package/dist/leaflet-html.cjs.map +0 -1
- package/dist/leaflet-html.modern.js +0 -2
- package/dist/leaflet-html.modern.js.map +0 -1
- package/dist/leaflet-html.umd.js +0 -2
- package/dist/leaflet-html.umd.js.map +0 -1
package/dist/leaflet-html.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as t from"leaflet";import{control as e,layerGroup as n,tileLayer as r,imageOverlay as a,videoOverlay as i,geoJSON as o,icon as l,divIcon as s,tooltip as u,Circle as c,Rectangle as p,Polygon as f,Polyline as b,circle as h,polyline as v,polygon as d,rectangle as m}from"leaflet";function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function g(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function E(){return E=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},E.apply(this,arguments)}function C(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,O(t,e)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function A(t){var e="function"==typeof Map?new Map:void 0;return A=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&O(a,n.prototype),a}(t,arguments,w(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,t)},A(t)}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var N="l:layer:connected",S="l:popup:connected",T="l:icon:connected",j="l:layer:removed",J="l:latlngbounds:connected",M="l:latlngbounds:changed",P="l:tooltip:connected",_="l:pane:connected",F=function(t,e,n){if(void 0===n&&(n=!0),t.hasAttribute("on")){var r=t.getAttribute("on");null!==r&&r.split(/\s+/).forEach(function(r){null!==e&&e.on(r,function(e){t.dispatchEvent(new CustomEvent(r,{bubbles:n,detail:e}))})})}},H=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(N,function(t){t.detail.type="base"})},e}(/*#__PURE__*/A(HTMLElement)),I=/*#__PURE__*/function(t){function n(){return t.call(this)||this}return C(n,t),n.prototype.connectedCallback=function(){var t=e.layers({},{});this.addEventListener(N,function(e){var n=e.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?t.addOverlay(i,a):"base"===r&&t.addBaseLayer(i,a),e.preventDefault()});var n=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:t}});this.dispatchEvent(n)},n}(/*#__PURE__*/A(HTMLElement)),z=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.disconnectedCallback=function(){var t;null==(t=this.layer)||t.remove()},e}(/*#__PURE__*/A(HTMLElement)),x=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("name"),e=n();this.layer=e;var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:e,name:t}});this.dispatchEvent(r),this.addEventListener(N,function(t){t.stopPropagation(),e.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var n=t.getAttribute("leaflet-id");if(null!==n){var r=e.getLayer(parseInt(n));void 0!==r&&e.removeLayer(r)}}})})}).observe(this,{childList:!0})},e}(z),B=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).issues=[],n.name="LeafletHTMLError",n.issues=e,n}return C(e,t),n=e,(r=[{key:"message",get:function(){return JSON.stringify(this.issues,null,2)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(/*#__PURE__*/A(Error)),U=function(t,e){var n=t(function(t){return{status:"clean",issues:[],value:t}}(e));if("clean"!==n.status)throw new B(n.issues);return n.value},R=function(t){return function(e){for(var n=e.issues,r="clean",a={},i=0,o=Object.keys(t);i<o.length;i++){var l=o[i],s=t[l](e);"clean"!==s.status&&(r=s.status),null===s.value&&"clean"===s.status||(n=[].concat(n,s.issues),a[l]=s.value)}return{status:r,issues:n,value:a}}},V=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length&&"abort"!==(e=t[n](e)).status;n++);return e}},D=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length;n++)e=t[n](e);return e}},G=function(t){return function(e){return null===e.value?e:t(e)}},W=function(t){return function(e){return null===(e=t(e)).value?{status:"clean",issues:[],value:null}:e}},Z=function(t){return function(e){var n=e.value,r=n.getAttribute(t);return null===r?{status:"abort",issues:[].concat(e.issues,[Q(n,t)]),value:null}:E({},e,{value:r})}},$=function(){return function(t){var e;try{e=JSON.parse(t.value)}catch(e){return{status:"abort",issues:[].concat(t.issues,[K(e)]),value:null}}return E({},t,{value:e})}},q=function(t){return V.apply(void 0,[Z(t)].concat([].slice.call(arguments,1)))},K=function(t){return{code:"parse_json",message:t.message}},Q=function(t,e){return{code:"missing_attribute",message:t.tagName.toLowerCase()+" missing attribute '"+e+"'"}},X=/*#__PURE__*/function(e){function n(){var t;(t=e.call(this)||this).map=null;var r=function(e){var n=e.detail;null!==t.map&&t.map[n.method](n.bounds)};return t.addEventListener(J,r),t.addEventListener(M,r),t.addEventListener(_,function(e){t.map.createPane(e.detail.name)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof n){var e=t.target;t.removedNodes.forEach(function(t){t instanceof z&&null!==e.map&&null!==t.layer&&(e.dispatchEvent(new CustomEvent(j,{bubbles:!0,detail:{layer:t.layer}})),e.map.removeLayer(t.layer))})}})}).observe(t,{childList:!0}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e,n=this;if(this.map=t.map(this,{zoomControl:this.hasAttribute("zoom-control")}),this.map.whenReady(function(){n.dispatchEvent(new CustomEvent("ready",{bubbles:!0,cancelable:!0,detail:n.map}))}),F(this,this.map),this.hasAttribute("fit-world"))this.map.fitWorld();else{var r=(e={zoom:q("zoom",function(t){var e,n=parseInt(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_int",message:'could not parse int given: "'+e+'"'})]),value:n}:E({},t,{value:n})}),center:q("center",$())},function(t){for(var n=t.status,r=t.issues,a={},i=0,o=Object.keys(e);i<o.length;i++){var l=o[i],s=e[l](t);"abort"===s.status&&(n="abort",r=[].concat(r,s.issues)),a[l]=s.value}return{status:n,issues:r,value:a}}),a=U(r,this);this.map.setView(a.center,a.zoom)}if(this.hasAttribute("locate")){var i=q("locate",$());this.map.locate(U(i,this))}this.addEventListener(N,function(t){n.map.addLayer(t.detail.layer)}),this.addEventListener(j,function(t){null!==n.map&&n.map.removeLayer(t.detail.layer)})},r.attributeChangedCallback=function(t,e,n){null!==this.map&&("zoom"===t?this.map.setZoom(parseInt(n)):"center"===t&&this.map.setView(JSON.parse(n)))},n}(/*#__PURE__*/A(HTMLElement));X.observedAttributes=["zoom","center","zoom-control"];var Y=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t.addEventListener(T,function(e){e.stopPropagation(),t.layer.setIcon(e.detail.icon)}),t.addEventListener(P,function(e){e.stopPropagation(),t.layer.bindTooltip(e.detail.tooltip)}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this,n=U(q("lat-lng",$()),this),r=U(R({opacity:D(W(Z("opacity")),G(function(t){var e,n=parseFloat(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_float",message:'could not parse float given: "'+e+'"'})]),value:n}:E({},t,{value:n})}))}),this),a=this.closest("l-pane");if(null!==a&&(r.pane=a.getAttribute("name")),this.layer=t.marker(n,r),this.hasAttribute("icon")){var i=t.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(i)}F(this,this.layer,!1),this.setAttribute("leaflet-id",t.stamp(this.layer)),this.addEventListener(S,function(t){var n=t.detail,r=n.openPopup,a=e.layer.bindPopup(n.content);r&&a.openPopup()});var o=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(o)},r.attributeChangedCallback=function(e,n,r){null!==this.layer&&("lat-lng"===e&&this.layer.setLatLng(JSON.parse(r)),"opacity"===e&&this.layer.setOpacity(parseFloat(r)),"icon"===e&&this.layer.setIcon(t.icon(JSON.parse(r))))},n}(z);Y.observedAttributes=["lat-lng","opacity","icon"];var tt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(N,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/A(HTMLElement)),et=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=!1,n=this.getAttribute("open-popup");null!==n&&(e="false"!==n);var r=new CustomEvent(S,{cancelable:!0,bubbles:!0,detail:{content:t,openPopup:e}});this.dispatchEvent(r)},e}(/*#__PURE__*/A(HTMLElement)),nt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){for(var t,n=U(Z("url-template"),this),a={},i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}(t))){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.parseTemplateAttributes(n));!(t=i()).done;){var o=t.value,l=this.getAttribute(o);null!==l&&(a[o]=l)}var s={};"l-pane"===this.parentElement.tagName.toLowerCase()&&(s.pane=this.parentElement.getAttribute("name"));var u=this.getAttribute("name"),c=R({attribution:W(Z("attribution")),errorTileUrl:W(Z("error-tile-url"))}),p=U(c,this);this.layer=r(n,E({},a,s,p));var f=new CustomEvent(N,{detail:{name:u,layer:this.layer},bubbles:!0});this.dispatchEvent(f)},e.parseTemplateAttributes=function(t){return[].concat(t.matchAll(/{(.*?)}/g)).map(function(t){return t[1]})},e}(z),rt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("bounds");null!==t&&this.dispatchEvent(this.getEvent(J,JSON.parse(t)))},n.attributeChangedCallback=function(t,e,n){this.dispatchEvent(this.getEvent(M,JSON.parse(n)))},n.getEvent=function(t,e){return new CustomEvent(t,{bubbles:!0,detail:{bounds:e,method:this.getAttribute("method")||"fitBounds"}})},e}(/*#__PURE__*/A(HTMLElement));rt.observedAttributes=["bounds"];var at=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("url");if(null!==t){var e=this.getAttribute("bounds");if(null!==e){var n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""},r=this.closest("l-pane");null!==r&&(n.pane=r.getAttribute("name")),this.layer=a(t,JSON.parse(e),n),this.dispatchEvent(new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},n.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},e}(z);at.observedAttributes=["url","bounds","opacity"];var it=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=JSON.parse(this.getAttribute("url")),e=JSON.parse(this.getAttribute("bounds")),n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},r=i(t,e,n);this.dispatchEvent(new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:r}}))},e}(z),ot=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("geojson"),e={},n=this.closest("l-pane");null!==n&&(e.pane=n.getAttribute("name")),null!==t&&(this.layer=o(JSON.parse(t),e),this.dispatchEvent(new CustomEvent(N,{bubbles:!0,cancelable:!0,detail:{layer:this.layer}})))},e}(/*#__PURE__*/A(HTMLElement)),lt=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},st=["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"],ut=["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"],ct=["cross-origin"],pt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){this.icon=l(this._parseOptions());var t=new CustomEvent(T,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(t)},n.attributeChangedCallback=function(t,n,r){if(-1!==e.observedAttributes.indexOf(t)&&null!==this.icon){var a={};-1!==st.indexOf(t)?a[lt(t)]=r:-1!==ct.indexOf(t)?a[lt(t)]="true"===r.toLowerCase():a[lt(t)]=JSON.parse(r),this.icon=l(E({},this.icon.options,a));var i=new CustomEvent(T,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(i)}},n._parseOptions=function(){var t={};st.forEach(function(e){t[lt(e)]=W(Z(e))}),ut.forEach(function(e){t[lt(e)]=D(W(Z(e)),G($()))}),t.crossOrigin=D(W(Z("cross-origin")),G(function(t){return E({},t,{value:"true"===t.value.toLowerCase()})}));var e=R(t);return U(e,this)},e}(/*#__PURE__*/A(HTMLElement));pt.observedAttributes=[].concat(st,ut,ct);var ft=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={html:this.innerHTML},e=this.getAttribute("class-name");null!==e&&(t.className=e),this.icon=s(t),this.dispatchEvent(new CustomEvent(T,{bubbles:!0,cancelable:!0,detail:{icon:this.icon}}))},e}(/*#__PURE__*/A(HTMLElement)),bt=/*#__PURE__*/function(t){function e(){var e,n;return(n=t.call(this)||this).tooltip=u({permanent:n.hasAttribute("permanent"),direction:null!=(e=n.getAttribute("direction"))?e:"auto"}),n}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=new CustomEvent(P,{cancelable:!0,bubbles:!0,detail:{tooltip:this.tooltip}});this.dispatchEvent(t)},n.attributeChangedCallback=function(t,e,n){"content"===t&&this.tooltip.setContent(n)},e}(/*#__PURE__*/A(HTMLElement));bt.observedAttributes=["content","permanent","direction"];var ht=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.dispatchEvent(new CustomEvent(_,{bubbles:!0,cancelable:!0,detail:{name:this.getAttribute("name")}}))},e}(/*#__PURE__*/A(HTMLElement)),vt=function(t){switch(t){case"circle":return[dt("latLng","latlng",null)];case"rectangle":return[dt("latLngBounds","latlngbounds",null)];case"polygon":case"polyline":return[dt("latLngs","latlng",null)]}},dt=function(t,e,n){return{camel:t,kebab:(r=t,r.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")),parser:mt(e),defaultValue:n};var r},mt=function(t){switch(t.toLowerCase()){case"boolean":return function(t){return"true"===t};case"number":return parseFloat;case"latlng":case"latlngbounds":return JSON.parse;default:return function(t){return t}}},yt=function(t){var e={circle:[dt("radius","number",null)],path:[dt("stroke","boolean",!0),dt("color","string","#3388ff"),dt("weight","number",3),dt("opacity","number",1),dt("lineCap","string","round"),dt("lineJoin","string","round"),dt("dashArray","string",null),dt("dashOffset","string",null),dt("fill","boolean",!0),dt("fillColor","string","#3388ff"),dt("fillOpacity","number",.2)],polyline:[dt("smoothFactor","number",1),dt("noClip","boolean",!1)],polygon:[],rectangle:[],interactiveLayer:[dt("interactive","boolean",!0)]};return Et(t).flatMap(function(t){return e[t]})},gt={circle:["path"],polyline:["path"],polygon:["polyline"],rectangle:["polygon"],path:["interactiveLayer"],interactiveLayer:[]},Et=function(t){for(var e=t,n=[t];gt[e].length>0;){var r=gt[e][0];n.push(r),e=r}return n},Ct=function(t,e){var n={};return yt(e).forEach(function(e){t.hasAttribute(e.kebab)&&(n[e.camel]=e.parser(t.getAttribute(e.kebab)))}),n},Lt=function(t,e){var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t.addEventListener(P,function(e){null!==t.layer&&t.layer.bindTooltip(e.detail.tooltip)}),t}C(r,n);var a=r.prototype;return a.connectedCallback=function(){var n=function(t,e){return vt(e).map(function(e){var n=Z(e.kebab),r=U(n,t);return e.parser(r)})}(this,e),r=Ct(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},a.attributeChangedCallback=function(t,n,r){null!==this.layer&&function(t,e,n,r){var a=[].concat(vt(e),yt(e)).find(function(t){return t.kebab===n});if(void 0!==a){var i=a.parser(r);if(t instanceof c)switch(n){case"lat-lng":t.setLatLng(JSON.parse(r));break;case"radius":t.setRadius(parseFloat(r))}else if(t instanceof p)switch(n){case"lat-lngs":t.setLatLngs(JSON.parse(r));break;case"lat-lng-bounds":t.setBounds(JSON.parse(r))}else t instanceof f?"lat-lngs"===n&&t.setLatLngs(JSON.parse(r)):t instanceof b&&"lat-lngs"===n&&t.setLatLngs(JSON.parse(r));var o,l=yt("polyline").find(function(t){return t.kebab===n});void 0!==l&&t.setStyle(((o={})[l.camel]=i,o))}}(this.layer,e,t,r)},r}(/*#__PURE__*/A(HTMLElement));return n.observedAttributes=function(t){var e=vt(t).map(function(t){return t.kebab}),n=yt(t).map(function(t){return t.kebab});return[].concat(e,n)}(e),n};import("leaflet.markercluster").catch(function(t){console.warn("Failed to import leaflet.markercluster",t)});var wt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this,e=this.getAttribute("name"),n=this.getAttribute("icon-options");this.layer=L.markerClusterGroup({showCoverageOnHover:this.hasAttribute("show-coverage-on-hover"),iconCreateFunction:this._createIconCreateFunction(n)});var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer,name:e}});this.dispatchEvent(r),this.addEventListener(N,function(e){e.stopPropagation(),t.layer.addLayer(e.detail.layer)})},n._createIconCreateFunction=function(t){var e=this;if(t){var n=JSON.parse(t),r=n.size,a=n.content,i=n.className;return function(t){var n=e._callClusterFunction(t,r),o=e._callClusterFunction(t,a);return L.divIcon({html:o,className:i,iconSize:new L.Point(n,n)})}}},n._callClusterFunction=function(t,e){return Function("cluster",'"use strict";return ('+e+")")(t)},e}(z);wt.observedAttributes=["show-coverage-on-hover","icon-options"];var Ot=(customElements.define("l-map",X),customElements.define("l-pane",ht),customElements.define("l-control-layers",I),customElements.define("l-base-layers",H),customElements.define("l-overlay-layers",tt),customElements.define("l-layer-group",x),customElements.define("l-tile-layer",nt),customElements.define("l-marker-cluster-group",wt),customElements.define("l-marker",Y),customElements.define("l-popup",et),customElements.define("l-lat-lng-bounds",rt),customElements.define("l-image-overlay",at),customElements.define("l-video-overlay",it),customElements.define("l-geojson",ot),customElements.define("l-icon",pt),customElements.define("l-circle",Lt(h,"circle")),customElements.define("l-polyline",Lt(v,"polyline")),customElements.define("l-polygon",Lt(d,"polygon")),customElements.define("l-rectangle",Lt(m,"rectangle")),customElements.define("l-tooltip",bt),void customElements.define("l-div-icon",ft));export{Ot as default};
|
1
|
+
import*as t from"leaflet";import{control as e,layerGroup as n,tileLayer as r,imageOverlay as a,videoOverlay as i,geoJSON as o,icon as l,divIcon as s,tooltip as u,Circle as c,Rectangle as p,Polygon as f,Polyline as h,circle as b,polyline as v,polygon as d,rectangle as m}from"leaflet";function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g.apply(null,arguments)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}function C(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,w(t,e)}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(A=function(){return!!t})()}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function O(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function k(t){var e="function"==typeof Map?new Map:void 0;return k=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(A())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&w(a,n.prototype),a}(t,arguments,E(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,t)},k(t)}var N="l:layer:connected",S="l:popup:connected",T="l:icon:connected",J="l:layer:removed",M="l:latlngbounds:connected",j="l:latlngbounds:changed",P="l:tooltip:connected",_="l:pane:connected",F=function(t,e,n){if(void 0===n&&(n=!0),t.hasAttribute("on")){var r=t.getAttribute("on");null!==r&&r.split(/\s+/).forEach(function(r){null!==e&&e.on(r,function(e){t.dispatchEvent(new CustomEvent(r,{bubbles:n,detail:e}))})})}},H=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(N,function(t){t.detail.type="base"})},e}(/*#__PURE__*/k(HTMLElement)),I=/*#__PURE__*/function(t){function n(){return t.call(this)||this}return C(n,t),n.prototype.connectedCallback=function(){var t=e.layers({},{});this.addEventListener(N,function(e){var n=e.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?t.addOverlay(i,a):"base"===r&&t.addBaseLayer(i,a),e.preventDefault()});var n=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:t}});this.dispatchEvent(n)},n}(/*#__PURE__*/k(HTMLElement)),z=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.disconnectedCallback=function(){var t;null==(t=this.layer)||t.remove()},e}(/*#__PURE__*/k(HTMLElement)),x=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("name"),e=n();this.layer=e;var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:e,name:t}});this.dispatchEvent(r),this.addEventListener(N,function(t){t.stopPropagation(),e.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var n=t.getAttribute("leaflet-id");if(null!==n){var r=e.getLayer(parseInt(n));void 0!==r&&e.removeLayer(r)}}})})}).observe(this,{childList:!0})},e}(z),B=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).issues=[],n.name="LeafletHTMLError",n.issues=e,n}return C(e,t),n=e,(r=[{key:"message",get:function(){return JSON.stringify(this.issues,null,2)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,O(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(/*#__PURE__*/k(Error)),U=function(t,e){var n=t(function(t){return{status:"clean",issues:[],value:t}}(e));if("clean"!==n.status)throw new B(n.issues);return n.value},R=function(t){return function(e){for(var n=e.issues,r="clean",a={},i=0,o=Object.keys(t);i<o.length;i++){var l=o[i],s=t[l](e);"clean"!==s.status&&(r=s.status),null===s.value&&"clean"===s.status||(n=[].concat(n,s.issues),a[l]=s.value)}return{status:r,issues:n,value:a}}},V=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length&&"abort"!==(e=t[n](e)).status;n++);return e}},D=function(){var t=[].slice.call(arguments);return function(e){for(var n=0;n<t.length;n++)e=t[n](e);return e}},G=function(t){return function(e){return null===e.value?e:t(e)}},W=function(t){return function(e){return null===(e=t(e)).value?{status:"clean",issues:[],value:null}:e}},Z=function(t){return function(e){var n=e.value,r=n.getAttribute(t);return null===r?{status:"abort",issues:[].concat(e.issues,[Q(n,t)]),value:null}:g({},e,{value:r})}},$=function(){return function(t){var e;try{e=JSON.parse(t.value)}catch(e){return{status:"abort",issues:[].concat(t.issues,[K(e)]),value:null}}return g({},t,{value:e})}},q=function(t){return V.apply(void 0,[Z(t)].concat([].slice.call(arguments,1)))},K=function(t){return{code:"parse_json",message:t.message}},Q=function(t,e){return{code:"missing_attribute",message:t.tagName.toLowerCase()+" missing attribute '"+e+"'"}},X=/*#__PURE__*/function(e){function n(){var t;(t=e.call(this)||this).map=null;var r=function(e){var n=e.detail;null!==t.map&&t.map[n.method](n.bounds)};return t.addEventListener(M,r),t.addEventListener(j,r),t.addEventListener(_,function(e){t.map.createPane(e.detail.name)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof n){var e=t.target;t.removedNodes.forEach(function(t){t instanceof z&&null!==e.map&&null!==t.layer&&(e.dispatchEvent(new CustomEvent(J,{bubbles:!0,detail:{layer:t.layer}})),e.map.removeLayer(t.layer))})}})}).observe(t,{childList:!0}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e,n=this;if(this.map=t.map(this,{zoomControl:this.hasAttribute("zoom-control")}),this.map.whenReady(function(){n.dispatchEvent(new CustomEvent("ready",{bubbles:!0,cancelable:!0,detail:n.map}))}),F(this,this.map),this.hasAttribute("fit-world"))this.map.fitWorld();else{var r=(e={zoom:q("zoom",function(t){var e,n=parseInt(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_int",message:'could not parse int given: "'+e+'"'})]),value:n}:g({},t,{value:n})}),center:q("center",$())},function(t){for(var n=t.status,r=t.issues,a={},i=0,o=Object.keys(e);i<o.length;i++){var l=o[i],s=e[l](t);"abort"===s.status&&(n="abort",r=[].concat(r,s.issues)),a[l]=s.value}return{status:n,issues:r,value:a}}),a=U(r,this);this.map.setView(a.center,a.zoom)}if(this.hasAttribute("locate")){var i=q("locate",$());this.map.locate(U(i,this))}this.addEventListener(N,function(t){n.map.addLayer(t.detail.layer)}),this.addEventListener(J,function(t){null!==n.map&&n.map.removeLayer(t.detail.layer)})},r.attributeChangedCallback=function(t,e,n){null!==this.map&&("zoom"===t?this.map.setZoom(parseInt(n)):"center"===t&&this.map.setView(JSON.parse(n)))},n}(/*#__PURE__*/k(HTMLElement));X.observedAttributes=["zoom","center","zoom-control"];var Y=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t.addEventListener(T,function(e){e.stopPropagation(),t.layer.setIcon(e.detail.icon)}),t.addEventListener(P,function(e){e.stopPropagation(),t.layer.bindTooltip(e.detail.tooltip)}),t}C(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this,n=U(q("lat-lng",$()),this),r=U(R({opacity:D(W(Z("opacity")),G(function(t){var e,n=parseFloat(t.value);return isNaN(n)?{status:"abort",issues:[].concat(t.issues,[(e=t.value,{code:"parse_float",message:'could not parse float given: "'+e+'"'})]),value:n}:g({},t,{value:n})}))}),this),a=this.closest("l-pane");if(null!==a&&(r.pane=a.getAttribute("name")),this.layer=t.marker(n,r),this.hasAttribute("icon")){var i=t.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(i)}F(this,this.layer,!1),this.setAttribute("leaflet-id",t.stamp(this.layer)),this.addEventListener(S,function(t){var n=t.detail,r=n.openPopup,a=e.layer.bindPopup(n.content);r&&a.openPopup()});var o=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(o)},r.attributeChangedCallback=function(e,n,r){null!==this.layer&&("lat-lng"===e&&this.layer.setLatLng(JSON.parse(r)),"opacity"===e&&this.layer.setOpacity(parseFloat(r)),"icon"===e&&this.layer.setIcon(t.icon(JSON.parse(r))))},n}(z);Y.observedAttributes=["lat-lng","opacity","icon"];var tt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.addEventListener(N,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/k(HTMLElement)),et=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=!1,n=this.getAttribute("open-popup");null!==n&&(e="false"!==n);var r=new CustomEvent(S,{cancelable:!0,bubbles:!0,detail:{content:t,openPopup:e}});this.dispatchEvent(r)},e}(/*#__PURE__*/k(HTMLElement)),nt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){for(var t,n=U(Z("url-template"),this),a={},i=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,e){if(t){if("string"==typeof t)return y(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(t))){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.parseTemplateAttributes(n));!(t=i()).done;){var o=t.value,l=this.getAttribute(o);null!==l&&(a[o]=l)}var s={};"l-pane"===this.parentElement.tagName.toLowerCase()&&(s.pane=this.parentElement.getAttribute("name"));var u=this.getAttribute("name"),c=R({attribution:W(Z("attribution")),errorTileUrl:W(Z("error-tile-url"))}),p=U(c,this);this.layer=r(n,g({},a,s,p));var f=new CustomEvent(N,{detail:{name:u,layer:this.layer},bubbles:!0});this.dispatchEvent(f)},e.parseTemplateAttributes=function(t){return[].concat(t.matchAll(/{(.*?)}/g)).map(function(t){return t[1]})},e}(z),rt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("bounds");null!==t&&this.dispatchEvent(this.getEvent(M,JSON.parse(t)))},n.attributeChangedCallback=function(t,e,n){this.dispatchEvent(this.getEvent(j,JSON.parse(n)))},n.getEvent=function(t,e){return new CustomEvent(t,{bubbles:!0,detail:{bounds:e,method:this.getAttribute("method")||"fitBounds"}})},e}(/*#__PURE__*/k(HTMLElement));rt.observedAttributes=["bounds"];var at=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this.getAttribute("url");if(null!==t){var e=this.getAttribute("bounds");if(null!==e){var n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""},r=this.closest("l-pane");null!==r&&(n.pane=r.getAttribute("name")),this.layer=a(t,JSON.parse(e),n),this.dispatchEvent(new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},n.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},e}(z);at.observedAttributes=["url","bounds","opacity"];var it=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){var t=JSON.parse(this.getAttribute("url")),e=JSON.parse(this.getAttribute("bounds")),n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},r=i(t,e,n);this.dispatchEvent(new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:r}}))},e}(z),ot=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("geojson"),e={},n=this.closest("l-pane");null!==n&&(e.pane=n.getAttribute("name")),null!==t&&(this.layer=o(JSON.parse(t),e),this.dispatchEvent(new CustomEvent(N,{bubbles:!0,cancelable:!0,detail:{layer:this.layer}})))},e}(/*#__PURE__*/k(HTMLElement)),lt=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},st=["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"],ut=["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"],ct=["cross-origin"],pt=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){this.icon=l(this._parseOptions());var t=new CustomEvent(T,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(t)},n.attributeChangedCallback=function(t,n,r){if(-1!==e.observedAttributes.indexOf(t)&&null!==this.icon){var a={};-1!==st.indexOf(t)?a[lt(t)]=r:-1!==ct.indexOf(t)?a[lt(t)]="true"===r.toLowerCase():a[lt(t)]=JSON.parse(r),this.icon=l(g({},this.icon.options,a));var i=new CustomEvent(T,{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(i)}},n._parseOptions=function(){var t={};st.forEach(function(e){t[lt(e)]=W(Z(e))}),ut.forEach(function(e){t[lt(e)]=D(W(Z(e)),G($()))}),t.crossOrigin=D(W(Z("cross-origin")),G(function(t){return g({},t,{value:"true"===t.value.toLowerCase()})}));var e=R(t);return U(e,this)},e}(/*#__PURE__*/k(HTMLElement));pt.observedAttributes=[].concat(st,ut,ct);var ft=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return C(e,t),e.prototype.connectedCallback=function(){var t={html:this.innerHTML},e=this.getAttribute("class-name");null!==e&&(t.className=e),this.icon=s(t),this.dispatchEvent(new CustomEvent(T,{bubbles:!0,cancelable:!0,detail:{icon:this.icon}}))},e}(/*#__PURE__*/k(HTMLElement)),ht=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).tooltip=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t;this.tooltip=u({permanent:this.hasAttribute("permanent"),interactive:this.hasAttribute("interactive"),direction:null!=(t=this.getAttribute("direction"))?t:"auto"}),this.tooltip.setContent(this.getAttribute("content"));var e=new CustomEvent(P,{cancelable:!0,bubbles:!0,detail:{tooltip:this.tooltip}});this.dispatchEvent(e)},n.attributeChangedCallback=function(t,e,n){this.tooltip&&("content"===t?this.tooltip.setContent(n):"permanent"===t?this.tooltip.options.permanent=this.hasAttribute("permanent"):"interactive"===t?this.tooltip.options.interactive=this.hasAttribute("interactive"):"direction"===t&&(this.tooltip.options.direction=n))},e}(/*#__PURE__*/k(HTMLElement));ht.observedAttributes=["content","permanent","interactive","direction"];var bt=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return C(e,t),e.prototype.connectedCallback=function(){this.dispatchEvent(new CustomEvent(_,{bubbles:!0,cancelable:!0,detail:{name:this.getAttribute("name")}}))},e}(/*#__PURE__*/k(HTMLElement)),vt=function(t){switch(t){case"circle":return[dt("latLng","latlng",null)];case"rectangle":return[dt("latLngBounds","latlngbounds",null)];case"polygon":case"polyline":return[dt("latLngs","latlng",null)]}},dt=function(t,e,n){return{camel:t,kebab:(r=t,r.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")),parser:mt(e),defaultValue:n};var r},mt=function(t){switch(t.toLowerCase()){case"boolean":return function(t){return"true"===t};case"number":return parseFloat;case"latlng":case"latlngbounds":return JSON.parse;default:return function(t){return t}}},yt=function(t){var e={circle:[dt("radius","number",null)],path:[dt("stroke","boolean",!0),dt("color","string","#3388ff"),dt("weight","number",3),dt("opacity","number",1),dt("lineCap","string","round"),dt("lineJoin","string","round"),dt("dashArray","string",null),dt("dashOffset","string",null),dt("fill","boolean",!0),dt("fillColor","string","#3388ff"),dt("fillOpacity","number",.2)],polyline:[dt("smoothFactor","number",1),dt("noClip","boolean",!1)],polygon:[],rectangle:[],interactiveLayer:[dt("interactive","boolean",!0)]};return Et(t).flatMap(function(t){return e[t]})},gt={circle:["path"],polyline:["path"],polygon:["polyline"],rectangle:["polygon"],path:["interactiveLayer"],interactiveLayer:[]},Et=function(t){for(var e=t,n=[t];gt[e].length>0;){var r=gt[e][0];n.push(r),e=r}return n},Ct=function(t,e){var n={};return yt(e).forEach(function(e){t.hasAttribute(e.kebab)&&(n[e.camel]=e.parser(t.getAttribute(e.kebab)))}),n},Lt=function(t,e){var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t.addEventListener(P,function(e){null!==t.layer&&t.layer.bindTooltip(e.detail.tooltip)}),t}C(r,n);var a=r.prototype;return a.connectedCallback=function(){var n=function(t,e){return vt(e).map(function(e){var n=Z(e.kebab),r=U(n,t);return e.parser(r)})}(this,e),r=Ct(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},a.attributeChangedCallback=function(t,n,r){null!==this.layer&&function(t,e,n,r){var a=[].concat(vt(e),yt(e)).find(function(t){return t.kebab===n});if(void 0!==a){var i=a.parser(r);if(t instanceof c)switch(n){case"lat-lng":t.setLatLng(JSON.parse(r));break;case"radius":t.setRadius(parseFloat(r))}else if(t instanceof p)switch(n){case"lat-lngs":t.setLatLngs(JSON.parse(r));break;case"lat-lng-bounds":t.setBounds(JSON.parse(r))}else t instanceof f?"lat-lngs"===n&&t.setLatLngs(JSON.parse(r)):t instanceof h&&"lat-lngs"===n&&t.setLatLngs(JSON.parse(r));var o,l=yt("polyline").find(function(t){return t.kebab===n});void 0!==l&&t.setStyle(((o={})[l.camel]=i,o))}}(this.layer,e,t,r)},r}(/*#__PURE__*/k(HTMLElement));return n.observedAttributes=function(t){var e=vt(t).map(function(t){return t.kebab}),n=yt(t).map(function(t){return t.kebab});return[].concat(e,n)}(e),n};import("leaflet.markercluster").catch(function(t){console.warn("Failed to import leaflet.markercluster",t)});var At=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}C(e,t);var n=e.prototype;return n.connectedCallback=function(){var t=this,e=this.getAttribute("name"),n=this.getAttribute("icon-options");this.layer=L.markerClusterGroup({showCoverageOnHover:this.hasAttribute("show-coverage-on-hover"),iconCreateFunction:this._createIconCreateFunction(n)});var r=new CustomEvent(N,{cancelable:!0,bubbles:!0,detail:{layer:this.layer,name:e}});this.dispatchEvent(r),this.addEventListener(N,function(e){e.stopPropagation(),t.layer.addLayer(e.detail.layer)})},n._createIconCreateFunction=function(t){var e=this;if(t){var n=JSON.parse(t),r=n.size,a=n.content,i=n.className;return function(t){var n=e._callClusterFunction(t,r),o=e._callClusterFunction(t,a);return L.divIcon({html:o,className:i,iconSize:new L.Point(n,n)})}}},n._callClusterFunction=function(t,e){return Function("cluster",'"use strict";return ('+e+")")(t)},e}(z);At.observedAttributes=["show-coverage-on-hover","icon-options"];var wt=(customElements.define("l-map",X),customElements.define("l-pane",bt),customElements.define("l-control-layers",I),customElements.define("l-base-layers",H),customElements.define("l-overlay-layers",tt),customElements.define("l-layer-group",x),customElements.define("l-tile-layer",nt),customElements.define("l-marker-cluster-group",At),customElements.define("l-marker",Y),customElements.define("l-popup",et),customElements.define("l-lat-lng-bounds",rt),customElements.define("l-image-overlay",at),customElements.define("l-video-overlay",it),customElements.define("l-geojson",ot),customElements.define("l-icon",pt),customElements.define("l-circle",Lt(b,"circle")),customElements.define("l-polyline",Lt(v,"polyline")),customElements.define("l-polygon",Lt(d,"polygon")),customElements.define("l-rectangle",Lt(m,"rectangle")),customElements.define("l-tooltip",ht),void customElements.define("l-div-icon",ft));export{wt as default};
|
2
2
|
//# sourceMappingURL=leaflet-html.js.map
|
package/dist/leaflet-html.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"leaflet-html.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/parse.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/util.js","../src/l-icon.js","../src/l-div-icon.js","../src/l-tooltip.js","../src/l-pane.js","../src/generator.js","../src/l-marker-cluster-group.js","../src/index.js"],"sourcesContent":["import { Evented } from \"leaflet\";\n\n// NOTE: These event keys are part of the public API of leaflet-html\nexport const layerConnected = \"l:layer:connected\";\nexport const popupConnected = \"l:popup:connected\";\nexport const iconConnected = \"l:icon:connected\";\nexport const layerRemoved = \"l:layer:removed\";\nexport const latLngBoundsConnected = \"l:latlngbounds:connected\";\nexport const latLngBoundsChanged = \"l:latlngbounds:changed\";\nexport const tooltipConnected = \"l:tooltip:connected\";\nexport const paneConnected = \"l:pane:connected\";\n\n/**\n * @param {HTMLElement} el\n * @param {Evented} evented\n * @param bubble determines whether events should bubble (defaults to true)\n */\nexport const connectLeafletEvents = (el, evented, bubble = true) => {\n if (el.hasAttribute(\"on\")) {\n const on = el.getAttribute(\"on\");\n if (on !== null) {\n on.split(/\\s+/).forEach((eventName) => {\n if (evented !== null) {\n evented.on(eventName, (e) => {\n el.dispatchEvent(\n new CustomEvent(eventName, { bubbles: bubble, detail: e })\n );\n });\n }\n });\n }\n }\n}\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(layerConnected, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n\n disconnectedCallback() {\n this.layer?.remove();\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","/// <reference path=\"./parser.d.ts\" />\n \nexport class LeafletHTMLError extends Error {\n /** @type {Issue[]} */\n issues = [];\n\n /**\n * @param {Issue[]} issues\n */\n constructor(issues) {\n super();\n this.name = \"LeafletHTMLError\";\n this.issues = issues;\n }\n\n get message() {\n return JSON.stringify(this.issues, null, 2);\n }\n}\n\n/**\n * @template T\n * @param {T} value\n * @returns {Context<T>}\n */\nconst wrap = (value) => {\n return {\n status: \"clean\",\n issues: [],\n value,\n };\n};\n\n/**\n * @template T\n * @param {Context<T>} value\n * @returns {T}\n */\nconst unwrap = ({ value }) => value;\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {S}\n */\nexport const parse = (schema, value) => {\n const result = schema(wrap(value));\n if (result.status !== \"clean\") {\n throw new LeafletHTMLError(result.issues);\n } else {\n return unwrap(result);\n }\n};\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {Context<S>}\n */\nexport const safeParse = (schema, value) => schema(wrap(value));\n\n/**\n * @param {Object} obj\n * @returns {(ctx: Context<Object>) => Context<Object>}\n */\nexport const object = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n if (key in ctx.value) {\n result[key] = obj[key](wrap(ctx.value[key])).value;\n } else {\n status = \"abort\";\n issues = [...issues, missingKeyIssue(key)];\n }\n }\n return { status, issues, value: result };\n};\n\n// CONNECTORS\n\n/**\n * @template T\n * @param {Object} obj\n * @returns {(ctx: Context<T>) => Context<Object>}\n */\nexport const distribute = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status === \"abort\") {\n status = \"abort\";\n issues = [...issues, ...localCtx.issues];\n }\n result[key] = localCtx.value;\n }\n return { status, issues, value: result };\n};\n\nexport const partial = (obj) => (ctx) => {\n let { issues } = ctx;\n let status = \"clean\"\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status !== \"clean\") {\n status = localCtx.status\n }\n \n if ((localCtx.value === null) && (localCtx.status === \"clean\")) {\n continue\n } else {\n issues = [...issues, ...localCtx.issues];\n result[key] = localCtx.value;\n }\n }\n return { status, issues, value: result };\n};\n\nexport const pipe =\n (...parsers) =>\n (ctx) => {\n for (let i = 0; i < parsers.length; i++) {\n ctx = parsers[i](ctx);\n if (ctx.status === \"abort\") {\n break;\n }\n }\n return ctx;\n };\n\nexport const chain = (...parsers) => (ctx) => {\n for (let i=0; i<parsers.length; i++) {\n ctx = parsers[i](ctx)\n }\n return ctx\n}\n\n\n// PRIMITIVES\nexport const nullable = (parser) => (ctx) => {\n if (ctx.value === null) {\n return ctx\n }\n return parser(ctx)\n}\n\nexport const optional = (parser) => (ctx) => {\n ctx = parser(ctx)\n if (ctx.value === null) {\n return {status: \"clean\", issues: [], value: null}\n } else {\n return ctx\n }\n}\n\n/**\n * @param {string} attributeName\n * @returns {Parser<HTMLElement, string>}\n */\nexport const htmlAttribute = (attributeName) => (ctx) => {\n const el = ctx.value;\n let result = el.getAttribute(attributeName);\n if (result === null) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, htmlAttributeIssue(el, attributeName)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const int = () => (ctx) => {\n let result = parseInt(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, intIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const float = () => (ctx) => {\n let result = parseFloat(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, floatIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const json = () => (ctx) => {\n let result;\n try {\n result = JSON.parse(ctx.value);\n } catch (e) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, jsonIssue(e)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<boolean>}\n */\nexport const bool = () => (ctx) => {\n return { ...ctx, value: ctx.value.toLowerCase() === \"true\" };\n};\n\n/**\n * @template T\n * @template S\n * @param {string} key\n * @param {Parser<T, S>[]} fns\n */\nexport const option = (key, ...fns) => pipe(htmlAttribute(key), ...fns);\n\n\n// ISSUES\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const intIssue = (value) => {\n return {\n code: \"parse_int\",\n message: `could not parse int given: \"${value}\"`,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const floatIssue = (value) => {\n return {\n code: \"parse_float\",\n message: `could not parse float given: \"${value}\"`,\n };\n};\n\n/**\n * @param {SyntaxError} e\n * @returns {Issue}\n */\nexport const jsonIssue = (e) => {\n return {\n code: \"parse_json\",\n message: e.message,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const missingKeyIssue = (value) => {\n return {\n code: \"missing_key\",\n message: `key not found: ${value}`,\n };\n};\n\n/**\n * @param {HTMLElement} el\n * @param {string} attributeName\n * @returns {Issue}\n */\nexport const htmlAttributeIssue = (el, attributeName) => {\n return {\n code: \"missing_attribute\",\n message: `${el.tagName.toLowerCase()} missing attribute '${attributeName}'`,\n };\n};\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemoved, layerConnected, latLngBoundsConnected, latLngBoundsChanged, paneConnected, connectLeafletEvents } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { distribute, int, json, option, parse } from \"./parse.js\";\n\nclass LMap extends HTMLElement {\n static observedAttributes = [\"zoom\", \"center\", \"zoom-control\"];\n\n constructor() {\n super();\n\n this.map = null;\n\n // Handle <l-lat-lng-bounds> connection and modification(s)\n const boundsListener = (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n };\n this.addEventListener(latLngBoundsConnected, boundsListener);\n this.addEventListener(latLngBoundsChanged, boundsListener);\n\n // Observe l-pane\n this.addEventListener(paneConnected, (ev) => {\n const { name } = ev.detail\n this.map.createPane(name)\n })\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target;\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if (el.map !== null && node.layer !== null) {\n // Notify listeners of layer removal\n el.dispatchEvent(new CustomEvent(layerRemoved, {\n bubbles: true,\n detail: {\n layer: node.layer\n }\n }))\n el.map.removeLayer(node.layer);\n }\n }\n });\n }\n });\n });\n observer.observe(this, { childList: true });\n }\n\n connectedCallback() {\n this.map = L.map(this, { zoomControl: this.hasAttribute(\"zoom-control\") });\n\n // Allow listeners to know when the map is \"ready\"\n this.map.whenReady(() => {\n this.dispatchEvent(\n new CustomEvent(\"ready\", {\n bubbles: true,\n cancelable: true,\n detail: this.map\n })\n )\n })\n\n // Connect Leaflet events\n connectLeafletEvents(this, this.map);\n\n if (this.hasAttribute(\"fit-world\")) {\n this.map.fitWorld();\n } else {\n const schema = distribute({\n zoom: option(\"zoom\", int()),\n center: option(\"center\", json())\n })\n const { zoom, center } = parse(schema, this)\n this.map.setView(center, zoom);\n }\n\n if (this.hasAttribute(\"locate\")) {\n const schema = option(\"locate\", json())\n this.map.locate(parse(schema, this));\n }\n\n this.addEventListener(layerConnected, (ev) => {\n const layer = ev.detail.layer;\n this.map.addLayer(layer);\n });\n\n this.addEventListener(layerRemoved, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.map !== null) {\n if (name === \"zoom\") {\n this.map.setZoom(parseInt(newValue));\n } else if (name === \"center\") {\n this.map.setView(JSON.parse(newValue));\n }\n }\n }\n}\n\nexport default LMap;\n","import * as L from \"leaflet\";\nimport {\n layerConnected,\n popupConnected,\n iconConnected,\n tooltipConnected,\n connectLeafletEvents,\n} from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport {\n chain,\n float,\n json,\n option,\n optional,\n htmlAttribute,\n parse,\n partial,\n nullable,\n} from \"./parse.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n\n // Icon connected\n this.addEventListener(iconConnected, (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n\n // Tooltip connected\n this.addEventListener(tooltipConnected, (ev) => {\n ev.stopPropagation();\n this.layer.bindTooltip(ev.detail.tooltip);\n });\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const latLng = parse(option(\"lat-lng\", json()), this);\n const options = parse(\n partial({\n opacity: chain(optional(htmlAttribute(\"opacity\")), nullable(float())),\n }),\n this\n );\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = L.marker(latLng, options);\n\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n // Connect Leaflet events\n connectLeafletEvents(this, this.layer, false);\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupConnected, (ev) => {\n const { content, openPopup } = ev.detail;\n const popup = this.layer.bindPopup(content);\n if (openPopup) {\n popup.openPopup();\n }\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nexport default LMarker;\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupConnected } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n let openPopup = false;\n const openPopupAttribute = this.getAttribute(\"open-popup\");\n if (openPopupAttribute !== null) {\n openPopup = openPopupAttribute !== \"false\";\n }\n const event = new CustomEvent(popupConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n openPopup,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { htmlAttribute, optional, parse, partial } from \"./parse.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const urlTemplate = parse(htmlAttribute(\"url-template\"), this)\n \n // Template attributes\n const urlAttributes = LTileLayer.parseTemplateAttributes(urlTemplate)\n const templateOptions = {}\n for (const attribute of urlAttributes) {\n const value = this.getAttribute(attribute)\n if (value !== null) {\n templateOptions[attribute] = value\n }\n }\n\n // Pane options\n const paneOptions = {}\n // Support <l-pane> parent element\n if (this.parentElement.tagName.toLowerCase() === \"l-pane\") {\n paneOptions[\"pane\"] = this.parentElement.getAttribute(\"name\")\n }\n \n // Options\n const name = this.getAttribute(\"name\");\n const schema = partial({\n attribution: optional(htmlAttribute(\"attribution\")),\n errorTileUrl: optional(htmlAttribute(\"error-tile-url\"))\n })\n const options = parse(schema, this)\n this.layer = tileLayer(urlTemplate, { ...templateOptions, ...paneOptions, ...options });\n const event = new CustomEvent(layerConnected, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} urlTemplate\n * @returns {string[]}\n */\n static parseTemplateAttributes(urlTemplate) {\n const regex = /{(.*?)}/g\n return [...urlTemplate.matchAll(regex)].map(match => match[1])\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nimport { LatLngBounds } from \"leaflet\";\nimport { latLngBoundsChanged, latLngBoundsConnected } from \"./events\"; \n\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n let value = this.getAttribute(\"bounds\")\n if (value !== null) {\n this.dispatchEvent(this.getEvent(latLngBoundsConnected, JSON.parse(value)))\n }\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n this.dispatchEvent(this.getEvent(latLngBoundsChanged, JSON.parse(newValue)));\n }\n\n /**\n * @param {LatLngBounds} bounds\n */\n getEvent(key, bounds) {\n return new CustomEvent(key, {\n bubbles: true,\n detail: {\n bounds,\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n const options = {};\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n if (value !== null) {\n this.layer = geoJSON(JSON.parse(value), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// Utility functions\nexport const kebabToCamel = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\nexport const camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\n","import { icon } from \"leaflet\";\nimport { iconConnected } from \"./events.js\";\nimport {\n bool,\n chain,\n htmlAttribute,\n json,\n nullable,\n optional,\n parse,\n partial,\n} from \"./parse.js\";\nimport { kebabToCamel } from \"./util.js\";\n\nconst STRING_ATTRIBUTES = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n];\n\nconst JSON_ATTRIBUTES = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n];\n\nconst BOOL_ATTRIBUTES = [\"cross-origin\"];\n\nclass LIcon extends HTMLElement {\n static observedAttributes = [\n ...STRING_ATTRIBUTES,\n ...JSON_ATTRIBUTES,\n ...BOOL_ATTRIBUTES,\n ];\n\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n this.icon = icon(this._parseOptions());\n\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} name\n * @param {string} _\n * @param {string} newValue\n */\n attributeChangedCallback(name, _, newValue) {\n if (LIcon.observedAttributes.indexOf(name) !== -1) {\n if (this.icon !== null) {\n let update = {};\n if (STRING_ATTRIBUTES.indexOf(name) !== -1) {\n update[kebabToCamel(name)] = newValue;\n } else if (BOOL_ATTRIBUTES.indexOf(name) !== -1) {\n update[kebabToCamel(name)] = newValue.toLowerCase() === \"true\";\n } else {\n update[kebabToCamel(name)] = JSON.parse(newValue);\n }\n this.icon = icon({\n ...this.icon.options,\n ...update,\n });\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n }\n }\n\n /**\n * @returns {import(\"leaflet\").IconOptions}\n */\n _parseOptions() {\n // Experimental parse/validate API\n const obj = {};\n STRING_ATTRIBUTES.forEach((key) => {\n obj[kebabToCamel(key)] = optional(htmlAttribute(key));\n });\n JSON_ATTRIBUTES.forEach((key) => {\n obj[kebabToCamel(key)] = chain(\n optional(htmlAttribute(key)),\n nullable(json())\n );\n });\n obj[\"crossOrigin\"] = chain(\n optional(htmlAttribute(\"cross-origin\")),\n nullable(bool())\n );\n const schema = partial(obj);\n return parse(schema, this);\n }\n}\n\nexport default LIcon;\n","import { divIcon } from \"leaflet\";\nimport { iconConnected } from \"./events\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Leaflet JS DivIcon options\n const options = {\n html: this.innerHTML,\n };\n const className = this.getAttribute(\"class-name\");\n if (className !== null) {\n options[\"className\"] = className;\n }\n\n this.icon = divIcon(options);\n this.dispatchEvent(\n new CustomEvent(iconConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n icon: this.icon,\n },\n })\n );\n }\n}\n","// @ts-check\n\nimport { tooltip } from \"leaflet\";\nimport { tooltipConnected } from \"./events\";\nimport { json, option, parse } from \"./parse.js\";\n\nclass LTooltip extends HTMLElement {\n static observedAttributes = [\"content\", \"permanent\", \"direction\"];\n\n constructor() {\n super();\n this.tooltip = tooltip({\n permanent: this.hasAttribute(\"permanent\"),\n direction: this.getAttribute(\"direction\") ?? \"auto\"\n });\n }\n\n connectedCallback() {\n const event = new CustomEvent(tooltipConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n tooltip: this.tooltip\n }\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (attName === \"content\") {\n this.tooltip.setContent(newValue);\n }\n }\n}\n\nexport default LTooltip;\n","import { paneConnected } from \"./events.js\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.dispatchEvent(\n new CustomEvent(paneConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n name: this.getAttribute(\"name\"),\n },\n })\n );\n }\n}\n","// @ts-check\nimport { Circle, LatLng, Polygon, Polyline, Rectangle } from \"leaflet\";\nimport { camelToKebab } from \"./util.js\";\nimport { htmlAttribute, parse } from \"./parse.js\";\nimport { layerConnected, tooltipConnected } from \"./events.js\";\n\n/**\n * @typedef {Object} TagOption\n * @property {string} camel\n * @property {string} kebab\n * @property {(s: string) => AttributeValue} parser\n * @property {AttributeValue | null} defaultValue\n */\n/**\n * @typedef {(\"circle\"|\"rectangle\"|\"polygon\"|\"polyline\")} MethodName\n * @typedef {(\"path\"|\"interactiveLayer\")} LayerName\n * @typedef {(\"boolean\"|\"number\"|\"string\"|\"latlng\"|\"latlngbounds\")} AttributeType\n * @typedef {(boolean|number|string|LatLng)} AttributeValue\n */\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst positionalArguments = (methodName) => {\n switch (methodName) {\n case \"circle\":\n return [option(\"latLng\", \"latlng\", null)];\n case \"rectangle\":\n return [option(\"latLngBounds\", \"latlngbounds\", null)];\n case \"polygon\":\n return [option(\"latLngs\", \"latlng\", null)];\n case \"polyline\":\n return [option(\"latLngs\", \"latlng\", null)];\n }\n};\n\n/**\n * @param {string} name\n * @param {AttributeType} type\n * @param {AttributeValue | null} defaultValue\n * @returns {TagOption}\n */\nconst option = (name, type, defaultValue) => {\n return {\n camel: name,\n kebab: camelToKebab(name),\n parser: inferParser(type),\n defaultValue,\n };\n};\n\n/**\n * @param {AttributeType} type\n * @returns {(s: string) => AttributeValue}\n */\nconst inferParser = (type) => {\n switch (type.toLowerCase()) {\n case \"boolean\":\n return (s) => s === \"true\";\n case \"number\":\n return parseFloat;\n case \"latlng\":\n case \"latlngbounds\":\n return JSON.parse;\n case \"string\":\n return (s) => s;\n default:\n return (s) => s;\n }\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst options = (methodName) => {\n const _OPTIONS = {\n circle: [option(\"radius\", \"number\", null)],\n path: [\n option(\"stroke\", \"boolean\", true),\n option(\"color\", \"string\", \"#3388ff\"),\n option(\"weight\", \"number\", 3),\n option(\"opacity\", \"number\", 1.0),\n option(\"lineCap\", \"string\", \"round\"),\n option(\"lineJoin\", \"string\", \"round\"),\n option(\"dashArray\", \"string\", null),\n option(\"dashOffset\", \"string\", null),\n option(\"fill\", \"boolean\", true),\n option(\"fillColor\", \"string\", \"#3388ff\"),\n option(\"fillOpacity\", \"number\", 0.2),\n ],\n polyline: [\n option(\"smoothFactor\", \"number\", 1.0),\n option(\"noClip\", \"boolean\", false),\n ],\n polygon: [],\n rectangle: [],\n interactiveLayer: [option(\"interactive\", \"boolean\", true)],\n };\n return inheritance(methodName).flatMap((parent) => _OPTIONS[parent]);\n};\n\n/**\n * @type {Object.<string, (MethodName | LayerName)[]>}\n */\nconst INHERITS = {\n circle: [\"path\"],\n polyline: [\"path\"],\n polygon: [\"polyline\"],\n rectangle: [\"polygon\"],\n path: [\"interactiveLayer\"],\n interactiveLayer: [],\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {(MethodName | LayerName)[]}\n */\nconst inheritance = (methodName) => {\n /** @type {(MethodName | LayerName)} */\n let name = methodName;\n let chain = [methodName];\n while (INHERITS[name].length > 0) {\n let parent = INHERITS[name][0];\n chain.push(parent);\n name = parent;\n }\n return chain;\n};\n\n/**\n * @param {MethodName} methodName\n * @param {string} newValue\n * @param {string} name\n * @param {(Circle | Rectangle | Polygon | Polyline)} layer\n */\nconst setter = (layer, methodName, name, newValue) => {\n // Parse\n const allOptions = [\n ...positionalArguments(methodName),\n ...options(methodName),\n ];\n let _opt = allOptions.find((o) => o.kebab === name);\n if (typeof _opt === \"undefined\") {\n return;\n }\n const parsedValue = _opt.parser(newValue);\n\n // Update\n if (layer instanceof Circle) {\n switch (name) {\n case \"lat-lng\":\n layer.setLatLng(JSON.parse(newValue));\n break;\n case \"radius\":\n layer.setRadius(parseFloat(newValue));\n break;\n }\n } else if (layer instanceof Rectangle) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n case \"lat-lng-bounds\":\n layer.setBounds(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polygon) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polyline) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n }\n\n // setStyle options\n let opt = options(\"polyline\").find((o) => o.kebab === name);\n if (typeof opt !== \"undefined\") {\n layer.setStyle({ [opt.camel]: parsedValue });\n }\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst attributes = (methodName) => {\n let args = positionalArguments(methodName).map((o) => o.kebab);\n let opts = options(methodName).map((o) => o.kebab);\n return [...args, ...opts];\n};\n\n/**\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {};\n\n // Process inheritance chain\n options(methodName).forEach((o) => {\n if (el.hasAttribute(o.kebab)) {\n result[o.camel] = o.parser(el.getAttribute(o.kebab));\n }\n });\n return result;\n};\n\n/**\n * Read positional arguments from HTMLElement\n *\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst positional = (el, methodName) => {\n return positionalArguments(methodName).map(option => {\n const schema = htmlAttribute(option.kebab)\n const value = parse(schema, el)\n return option.parser(value);\n })\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst generator = (method, methodName) => {\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(tooltipConnected, (ev) => {\n if (this.layer !== null) {\n this.layer.bindTooltip(ev.detail.tooltip);\n }\n });\n }\n\n connectedCallback() {\n const args = positional(this, methodName);\n const options = settings(this, methodName);\n this.layer = method(...args, options);\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, methodName, attName, newValue);\n }\n }\n }\n return cls;\n};\n\nexport default generator;\n","// @ts-check\n\n// Make L.markerClusterGroup optional\nimport(\"leaflet.markercluster\").catch((error) => {\n console.warn(\"Failed to import leaflet.markercluster\", error)\n});\n\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMarkerClusterGroup extends LLayer {\n static observedAttributes = [\n \"show-coverage-on-hover\",\n \"icon-options\"\n ];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const iconOptions = this.getAttribute(\"icon-options\");\n this.layer = L.markerClusterGroup({\n showCoverageOnHover: this.hasAttribute(\"show-coverage-on-hover\"),\n iconCreateFunction: this._createIconCreateFunction(iconOptions)\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n name\n }\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n this.layer.addLayer(ev.detail.layer);\n });\n }\n\n _createIconCreateFunction(iconOptions) {\n if (iconOptions) {\n let { size, content, className } = JSON.parse(iconOptions);\n\n return (cluster) => {\n const resolvedSize = this._callClusterFunction(cluster, size);\n const resolvedContent = this._callClusterFunction(cluster, content);\n\n return L.divIcon({\n html: resolvedContent,\n className: className,\n iconSize: new L.Point(resolvedSize, resolvedSize)\n });\n };\n }\n }\n\n _callClusterFunction(cluster, body) {\n return Function(\"cluster\", `\"use strict\";return (${body})`)(cluster);\n }\n}\n\nexport default LMarkerClusterGroup;\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport LDivIcon from \"./l-div-icon.js\";\nimport LTooltip from \"./l-tooltip.js\";\nimport LPane from \"./l-pane.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\";\nimport LMarkerClusterGroup from \"./l-marker-cluster-group.js\";\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-pane\", LPane);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker-cluster-group\", LMarkerClusterGroup);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"));\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"));\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"));\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"));\n customElements.define(\"l-tooltip\", LTooltip);\n customElements.define(\"l-div-icon\", LDivIcon);\n})();\n\nexport default init;\n"],"names":["layerConnected","popupConnected","iconConnected","layerRemoved","latLngBoundsConnected","latLngBoundsChanged","tooltipConnected","paneConnected","connectLeafletEvents","el","evented","bubble","hasAttribute","on","getAttribute","split","forEach","eventName","e","dispatchEvent","CustomEvent","bubbles","detail","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","cancelable","LLayer","_this","disconnectedCallback","_this$layer","remove","LLayerGroup","_LLayer","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LeafletHTMLError","_Error","issues","key","get","JSON","stringify","Error","parse","schema","value","result","status","wrap","partial","obj","ctx","_i3","_Object$keys3","Object","keys","length","localCtx","concat","pipe","parsers","slice","arguments","i","chain","nullable","parser","optional","htmlAttribute","attributeName","htmlAttributeIssue","_extends","json","jsonIssue","option","apply","code","message","tagName","toLowerCase","LMap","map","boundsListener","method","bounds","createPane","target","_proto","_this2","L","zoomControl","whenReady","fitWorld","zoom","isNaN","center","_i2","_Object$keys2","_parse","setView","locate","attributeChangedCallback","_oldValue","newValue","setZoom","observedAttributes","LMarker","setIcon","icon","bindTooltip","tooltip","latLng","options","opacity","parseFloat","pane","closest","marker","setAttribute","stamp","openPopup","popup","bindPopup","content","setLatLng","setOpacity","LOverlayLayers","LPopup","openPopupAttribute","LTileLayer","_step","urlTemplate","templateOptions","_iterator","_createForOfIteratorHelperLoose","parseTemplateAttributes","done","attribute","paneOptions","parentElement","attribution","errorTileUrl","tileLayer","matchAll","match","LLatLngBounds","getEvent","_name","LImageOverlay","url","alt","imageOverlay","console","warn","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","geoJSON","kebabToCamel","kebab","replace","x","toUpperCase","STRING_ATTRIBUTES","JSON_ATTRIBUTES","BOOL_ATTRIBUTES","LIcon","_parseOptions","_","indexOf","update","CustomElement","html","innerHTML","className","divIcon","LTooltip","_this$getAttribute","permanent","direction","attName","setContent","positionalArguments","methodName","defaultValue","camel","s","letter","idx","join","inferParser","_OPTIONS","circle","path","polyline","polygon","rectangle","interactiveLayer","inheritance","flatMap","parent","INHERITS","push","settings","o","generator","cls","args","positional","_opt","find","parsedValue","Circle","setRadius","Rectangle","setLatLngs","Polygon","Polyline","_layer$setStyle","opt","setStyle","setter","opts","attributes","import","error","LMarkerClusterGroup","iconOptions","markerClusterGroup","showCoverageOnHover","iconCreateFunction","_createIconCreateFunction","_this3","_JSON$parse","size","cluster","resolvedSize","_callClusterFunction","resolvedContent","iconSize","Point","body","Function","init","customElements","define","LPane","LDivIcon"],"mappings":"+jEAGaA,EAAiB,oBACjBC,EAAiB,oBACjBC,EAAgB,mBAChBC,EAAe,kBACfC,EAAwB,2BACxBC,EAAsB,yBACtBC,EAAmB,sBACnBC,EAAgB,mBAOhBC,EAAuB,SAACC,EAAIC,EAASC,GAChD,QADgDA,IAAAA,IAAAA,GAAS,GACrDF,EAAGG,aAAa,MAAO,CACzB,IAAMC,EAAKJ,EAAGK,aAAa,MAChB,OAAPD,GACFA,EAAGE,MAAM,OAAOC,QAAQ,SAACC,GACP,OAAZP,GACFA,EAAQG,GAAGI,EAAW,SAACC,GACrBT,EAAGU,cACD,IAAIC,YAAYH,EAAW,CAAEI,QAASV,EAAQW,OAAQJ,IAE1D,EAEJ,EAEJ,CACF,EC7BMK,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,EAAAC,GAAAD,EAAAK,UAEDC,kBAAA,WACEH,KAAKI,iBAAiB9B,EAAgB,SAAC+B,GACrCA,EAAGT,OAAa,KAAI,MACtB,EACF,EAACC,CAAA,CATcC,cASdQ,EATuBC,cCEpBC,eAAc,SAAAV,GAClB,SAAAU,IAAc,OACZV,EAAAC,KAAMC,WACR,CA2BC,OA3BAC,EAAAO,EAAAV,GAAAU,EAAAN,UAEDC,kBAAA,WAEE,IAGMM,EAAgBC,EAAQC,OAHjB,CAAA,EAEG,CAAE,GAGlBX,KAAKI,iBAAiB9B,EAAgB,SAAC+B,GACrC,IAAAO,EAA8BP,EAAGT,OAAzBiB,EAAID,EAAJC,KAAMC,EAAIF,EAAJE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OAAO,YAAaxC,GAAUV,EAAS,YACtDiD,eAAeC,OAAO,cAAexC,GAAUT,EAAW,cAC1DgD,eAAeC,OAAO,YAAarE,SACnCoE,eAAeC,OAAO,aAAcE"}
|
1
|
+
{"version":3,"file":"leaflet-html.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/parse.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/util.js","../src/l-icon.js","../src/l-div-icon.js","../src/l-tooltip.js","../src/l-pane.js","../src/generator.js","../src/l-marker-cluster-group.js","../src/index.js"],"sourcesContent":["import { Evented } from \"leaflet\";\n\n// NOTE: These event keys are part of the public API of leaflet-html\nexport const layerConnected = \"l:layer:connected\";\nexport const popupConnected = \"l:popup:connected\";\nexport const iconConnected = \"l:icon:connected\";\nexport const layerRemoved = \"l:layer:removed\";\nexport const latLngBoundsConnected = \"l:latlngbounds:connected\";\nexport const latLngBoundsChanged = \"l:latlngbounds:changed\";\nexport const tooltipConnected = \"l:tooltip:connected\";\nexport const paneConnected = \"l:pane:connected\";\n\n/**\n * @param {HTMLElement} el\n * @param {Evented} evented\n * @param bubble determines whether events should bubble (defaults to true)\n */\nexport const connectLeafletEvents = (el, evented, bubble = true) => {\n if (el.hasAttribute(\"on\")) {\n const on = el.getAttribute(\"on\");\n if (on !== null) {\n on.split(/\\s+/).forEach((eventName) => {\n if (evented !== null) {\n evented.on(eventName, (e) => {\n el.dispatchEvent(\n new CustomEvent(eventName, { bubbles: bubble, detail: e })\n );\n });\n }\n });\n }\n }\n}\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(layerConnected, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n\n disconnectedCallback() {\n this.layer?.remove();\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","/// <reference path=\"./parser.d.ts\" />\n \nexport class LeafletHTMLError extends Error {\n /** @type {Issue[]} */\n issues = [];\n\n /**\n * @param {Issue[]} issues\n */\n constructor(issues) {\n super();\n this.name = \"LeafletHTMLError\";\n this.issues = issues;\n }\n\n get message() {\n return JSON.stringify(this.issues, null, 2);\n }\n}\n\n/**\n * @template T\n * @param {T} value\n * @returns {Context<T>}\n */\nconst wrap = (value) => {\n return {\n status: \"clean\",\n issues: [],\n value,\n };\n};\n\n/**\n * @template T\n * @param {Context<T>} value\n * @returns {T}\n */\nconst unwrap = ({ value }) => value;\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {S}\n */\nexport const parse = (schema, value) => {\n const result = schema(wrap(value));\n if (result.status !== \"clean\") {\n throw new LeafletHTMLError(result.issues);\n } else {\n return unwrap(result);\n }\n};\n\n/**\n * @template S\n * @template T\n * @param {Parser<T, S>} schema\n * @param {T} value\n * @returns {Context<S>}\n */\nexport const safeParse = (schema, value) => schema(wrap(value));\n\n/**\n * @param {Object} obj\n * @returns {(ctx: Context<Object>) => Context<Object>}\n */\nexport const object = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n if (key in ctx.value) {\n result[key] = obj[key](wrap(ctx.value[key])).value;\n } else {\n status = \"abort\";\n issues = [...issues, missingKeyIssue(key)];\n }\n }\n return { status, issues, value: result };\n};\n\n// CONNECTORS\n\n/**\n * @template T\n * @param {Object} obj\n * @returns {(ctx: Context<T>) => Context<Object>}\n */\nexport const distribute = (obj) => (ctx) => {\n let { status, issues } = ctx;\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status === \"abort\") {\n status = \"abort\";\n issues = [...issues, ...localCtx.issues];\n }\n result[key] = localCtx.value;\n }\n return { status, issues, value: result };\n};\n\nexport const partial = (obj) => (ctx) => {\n let { issues } = ctx;\n let status = \"clean\"\n const result = {};\n for (const key of Object.keys(obj)) {\n let localCtx = obj[key](ctx);\n if (localCtx.status !== \"clean\") {\n status = localCtx.status\n }\n \n if ((localCtx.value === null) && (localCtx.status === \"clean\")) {\n continue\n } else {\n issues = [...issues, ...localCtx.issues];\n result[key] = localCtx.value;\n }\n }\n return { status, issues, value: result };\n};\n\nexport const pipe =\n (...parsers) =>\n (ctx) => {\n for (let i = 0; i < parsers.length; i++) {\n ctx = parsers[i](ctx);\n if (ctx.status === \"abort\") {\n break;\n }\n }\n return ctx;\n };\n\nexport const chain = (...parsers) => (ctx) => {\n for (let i=0; i<parsers.length; i++) {\n ctx = parsers[i](ctx)\n }\n return ctx\n}\n\n\n// PRIMITIVES\nexport const nullable = (parser) => (ctx) => {\n if (ctx.value === null) {\n return ctx\n }\n return parser(ctx)\n}\n\nexport const optional = (parser) => (ctx) => {\n ctx = parser(ctx)\n if (ctx.value === null) {\n return {status: \"clean\", issues: [], value: null}\n } else {\n return ctx\n }\n}\n\n/**\n * @param {string} attributeName\n * @returns {Parser<HTMLElement, string>}\n */\nexport const htmlAttribute = (attributeName) => (ctx) => {\n const el = ctx.value;\n let result = el.getAttribute(attributeName);\n if (result === null) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, htmlAttributeIssue(el, attributeName)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const int = () => (ctx) => {\n let result = parseInt(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, intIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const float = () => (ctx) => {\n let result = parseFloat(ctx.value);\n if (isNaN(result)) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, floatIssue(ctx.value)],\n value: result,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<number>}\n */\nexport const json = () => (ctx) => {\n let result;\n try {\n result = JSON.parse(ctx.value);\n } catch (e) {\n return {\n status: \"abort\",\n issues: [...ctx.issues, jsonIssue(e)],\n value: null,\n };\n }\n return { ...ctx, value: result };\n};\n\n/**\n * @returns {(ctx: Context<string>) => Context<boolean>}\n */\nexport const bool = () => (ctx) => {\n return { ...ctx, value: ctx.value.toLowerCase() === \"true\" };\n};\n\n/**\n * @template T\n * @template S\n * @param {string} key\n * @param {Parser<T, S>[]} fns\n */\nexport const option = (key, ...fns) => pipe(htmlAttribute(key), ...fns);\n\n\n// ISSUES\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const intIssue = (value) => {\n return {\n code: \"parse_int\",\n message: `could not parse int given: \"${value}\"`,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const floatIssue = (value) => {\n return {\n code: \"parse_float\",\n message: `could not parse float given: \"${value}\"`,\n };\n};\n\n/**\n * @param {SyntaxError} e\n * @returns {Issue}\n */\nexport const jsonIssue = (e) => {\n return {\n code: \"parse_json\",\n message: e.message,\n };\n};\n\n/**\n * @param {string} value\n * @returns {Issue}\n */\nexport const missingKeyIssue = (value) => {\n return {\n code: \"missing_key\",\n message: `key not found: ${value}`,\n };\n};\n\n/**\n * @param {HTMLElement} el\n * @param {string} attributeName\n * @returns {Issue}\n */\nexport const htmlAttributeIssue = (el, attributeName) => {\n return {\n code: \"missing_attribute\",\n message: `${el.tagName.toLowerCase()} missing attribute '${attributeName}'`,\n };\n};\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemoved, layerConnected, latLngBoundsConnected, latLngBoundsChanged, paneConnected, connectLeafletEvents } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { distribute, int, json, option, parse } from \"./parse.js\";\n\nclass LMap extends HTMLElement {\n static observedAttributes = [\"zoom\", \"center\", \"zoom-control\"];\n\n constructor() {\n super();\n\n this.map = null;\n\n // Handle <l-lat-lng-bounds> connection and modification(s)\n const boundsListener = (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n };\n this.addEventListener(latLngBoundsConnected, boundsListener);\n this.addEventListener(latLngBoundsChanged, boundsListener);\n\n // Observe l-pane\n this.addEventListener(paneConnected, (ev) => {\n const { name } = ev.detail\n this.map.createPane(name)\n })\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target;\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if (el.map !== null && node.layer !== null) {\n // Notify listeners of layer removal\n el.dispatchEvent(new CustomEvent(layerRemoved, {\n bubbles: true,\n detail: {\n layer: node.layer\n }\n }))\n el.map.removeLayer(node.layer);\n }\n }\n });\n }\n });\n });\n observer.observe(this, { childList: true });\n }\n\n connectedCallback() {\n this.map = L.map(this, { zoomControl: this.hasAttribute(\"zoom-control\") });\n\n // Allow listeners to know when the map is \"ready\"\n this.map.whenReady(() => {\n this.dispatchEvent(\n new CustomEvent(\"ready\", {\n bubbles: true,\n cancelable: true,\n detail: this.map\n })\n )\n })\n\n // Connect Leaflet events\n connectLeafletEvents(this, this.map);\n\n if (this.hasAttribute(\"fit-world\")) {\n this.map.fitWorld();\n } else {\n const schema = distribute({\n zoom: option(\"zoom\", int()),\n center: option(\"center\", json())\n })\n const { zoom, center } = parse(schema, this)\n this.map.setView(center, zoom);\n }\n\n if (this.hasAttribute(\"locate\")) {\n const schema = option(\"locate\", json())\n this.map.locate(parse(schema, this));\n }\n\n this.addEventListener(layerConnected, (ev) => {\n const layer = ev.detail.layer;\n this.map.addLayer(layer);\n });\n\n this.addEventListener(layerRemoved, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.map !== null) {\n if (name === \"zoom\") {\n this.map.setZoom(parseInt(newValue));\n } else if (name === \"center\") {\n this.map.setView(JSON.parse(newValue));\n }\n }\n }\n}\n\nexport default LMap;\n","import * as L from \"leaflet\";\nimport {\n layerConnected,\n popupConnected,\n iconConnected,\n tooltipConnected,\n connectLeafletEvents,\n} from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport {\n chain,\n float,\n json,\n option,\n optional,\n htmlAttribute,\n parse,\n partial,\n nullable,\n} from \"./parse.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n\n // Icon connected\n this.addEventListener(iconConnected, (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n\n // Tooltip connected\n this.addEventListener(tooltipConnected, (ev) => {\n ev.stopPropagation();\n this.layer.bindTooltip(ev.detail.tooltip);\n });\n }\n\n connectedCallback() {\n // Experimental parse/validate API\n const latLng = parse(option(\"lat-lng\", json()), this);\n const options = parse(\n partial({\n opacity: chain(optional(htmlAttribute(\"opacity\")), nullable(float())),\n }),\n this\n );\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = L.marker(latLng, options);\n\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n // Connect Leaflet events\n connectLeafletEvents(this, this.layer, false);\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupConnected, (ev) => {\n const { content, openPopup } = ev.detail;\n const popup = this.layer.bindPopup(content);\n if (openPopup) {\n popup.openPopup();\n }\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nexport default LMarker;\n","// @ts-check\nimport { layerConnected } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(layerConnected, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupConnected } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n let openPopup = false;\n const openPopupAttribute = this.getAttribute(\"open-popup\");\n if (openPopupAttribute !== null) {\n openPopup = openPopupAttribute !== \"false\";\n }\n const event = new CustomEvent(popupConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n openPopup,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\nimport { htmlAttribute, optional, parse, partial } from \"./parse.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const urlTemplate = parse(htmlAttribute(\"url-template\"), this)\n \n // Template attributes\n const urlAttributes = LTileLayer.parseTemplateAttributes(urlTemplate)\n const templateOptions = {}\n for (const attribute of urlAttributes) {\n const value = this.getAttribute(attribute)\n if (value !== null) {\n templateOptions[attribute] = value\n }\n }\n\n // Pane options\n const paneOptions = {}\n // Support <l-pane> parent element\n if (this.parentElement.tagName.toLowerCase() === \"l-pane\") {\n paneOptions[\"pane\"] = this.parentElement.getAttribute(\"name\")\n }\n \n // Options\n const name = this.getAttribute(\"name\");\n const schema = partial({\n attribution: optional(htmlAttribute(\"attribution\")),\n errorTileUrl: optional(htmlAttribute(\"error-tile-url\"))\n })\n const options = parse(schema, this)\n this.layer = tileLayer(urlTemplate, { ...templateOptions, ...paneOptions, ...options });\n const event = new CustomEvent(layerConnected, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} urlTemplate\n * @returns {string[]}\n */\n static parseTemplateAttributes(urlTemplate) {\n const regex = /{(.*?)}/g\n return [...urlTemplate.matchAll(regex)].map(match => match[1])\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nimport { LatLngBounds } from \"leaflet\";\nimport { latLngBoundsChanged, latLngBoundsConnected } from \"./events\"; \n\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n let value = this.getAttribute(\"bounds\")\n if (value !== null) {\n this.dispatchEvent(this.getEvent(latLngBoundsConnected, JSON.parse(value)))\n }\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n this.dispatchEvent(this.getEvent(latLngBoundsChanged, JSON.parse(newValue)));\n }\n\n /**\n * @param {LatLngBounds} bounds\n */\n getEvent(key, bounds) {\n return new CustomEvent(key, {\n bubbles: true,\n detail: {\n bounds,\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { layerConnected } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n const options = {};\n\n // Pane\n const pane = this.closest(\"l-pane\");\n if (pane !== null) {\n options[\"pane\"] = pane.getAttribute(\"name\");\n }\n\n if (value !== null) {\n this.layer = geoJSON(JSON.parse(value), options);\n this.dispatchEvent(\n new CustomEvent(layerConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer: this.layer,\n },\n })\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// Utility functions\nexport const kebabToCamel = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\nexport const camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\n","import { icon } from \"leaflet\";\nimport { iconConnected } from \"./events.js\";\nimport {\n bool,\n chain,\n htmlAttribute,\n json,\n nullable,\n optional,\n parse,\n partial,\n} from \"./parse.js\";\nimport { kebabToCamel } from \"./util.js\";\n\nconst STRING_ATTRIBUTES = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n];\n\nconst JSON_ATTRIBUTES = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n];\n\nconst BOOL_ATTRIBUTES = [\"cross-origin\"];\n\nclass LIcon extends HTMLElement {\n static observedAttributes = [\n ...STRING_ATTRIBUTES,\n ...JSON_ATTRIBUTES,\n ...BOOL_ATTRIBUTES,\n ];\n\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n this.icon = icon(this._parseOptions());\n\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} name\n * @param {string} _\n * @param {string} newValue\n */\n attributeChangedCallback(name, _, newValue) {\n if (LIcon.observedAttributes.indexOf(name) !== -1) {\n if (this.icon !== null) {\n let update = {};\n if (STRING_ATTRIBUTES.indexOf(name) !== -1) {\n update[kebabToCamel(name)] = newValue;\n } else if (BOOL_ATTRIBUTES.indexOf(name) !== -1) {\n update[kebabToCamel(name)] = newValue.toLowerCase() === \"true\";\n } else {\n update[kebabToCamel(name)] = JSON.parse(newValue);\n }\n this.icon = icon({\n ...this.icon.options,\n ...update,\n });\n const event = new CustomEvent(iconConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n }\n }\n\n /**\n * @returns {import(\"leaflet\").IconOptions}\n */\n _parseOptions() {\n // Experimental parse/validate API\n const obj = {};\n STRING_ATTRIBUTES.forEach((key) => {\n obj[kebabToCamel(key)] = optional(htmlAttribute(key));\n });\n JSON_ATTRIBUTES.forEach((key) => {\n obj[kebabToCamel(key)] = chain(\n optional(htmlAttribute(key)),\n nullable(json())\n );\n });\n obj[\"crossOrigin\"] = chain(\n optional(htmlAttribute(\"cross-origin\")),\n nullable(bool())\n );\n const schema = partial(obj);\n return parse(schema, this);\n }\n}\n\nexport default LIcon;\n","import { divIcon } from \"leaflet\";\nimport { iconConnected } from \"./events\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n // Leaflet JS DivIcon options\n const options = {\n html: this.innerHTML,\n };\n const className = this.getAttribute(\"class-name\");\n if (className !== null) {\n options[\"className\"] = className;\n }\n\n this.icon = divIcon(options);\n this.dispatchEvent(\n new CustomEvent(iconConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n icon: this.icon,\n },\n })\n );\n }\n}\n","// @ts-check\n\nimport { tooltip } from \"leaflet\";\nimport { tooltipConnected } from \"./events\";\n\nclass LTooltip extends HTMLElement {\n static observedAttributes = [\"content\", \"permanent\", \"interactive\", \"direction\"];\n\n constructor() {\n super();\n this.tooltip = null;\n }\n\n connectedCallback() {\n this.tooltip = tooltip({\n permanent: this.hasAttribute(\"permanent\"),\n interactive: this.hasAttribute(\"interactive\"),\n direction: this.getAttribute(\"direction\") ?? \"auto\"\n });\n this.tooltip.setContent(this.getAttribute(\"content\"));\n\n const event = new CustomEvent(tooltipConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n tooltip: this.tooltip\n }\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (this.tooltip) {\n if (attName === \"content\") {\n this.tooltip.setContent(newValue);\n } else if (attName === \"permanent\") {\n this.tooltip.options.permanent = this.hasAttribute(\"permanent\");\n } else if (attName === \"interactive\") {\n this.tooltip.options.interactive = this.hasAttribute(\"interactive\");\n } else if (attName === \"direction\") {\n this.tooltip.options.direction = newValue;\n }\n }\n }\n}\n\nexport default LTooltip;\n","import { paneConnected } from \"./events.js\";\n\nexport default class CustomElement extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.dispatchEvent(\n new CustomEvent(paneConnected, {\n bubbles: true,\n cancelable: true,\n detail: {\n name: this.getAttribute(\"name\"),\n },\n })\n );\n }\n}\n","// @ts-check\nimport { Circle, LatLng, Polygon, Polyline, Rectangle } from \"leaflet\";\nimport { camelToKebab } from \"./util.js\";\nimport { htmlAttribute, parse } from \"./parse.js\";\nimport { layerConnected, tooltipConnected } from \"./events.js\";\n\n/**\n * @typedef {Object} TagOption\n * @property {string} camel\n * @property {string} kebab\n * @property {(s: string) => AttributeValue} parser\n * @property {AttributeValue | null} defaultValue\n */\n/**\n * @typedef {(\"circle\"|\"rectangle\"|\"polygon\"|\"polyline\")} MethodName\n * @typedef {(\"path\"|\"interactiveLayer\")} LayerName\n * @typedef {(\"boolean\"|\"number\"|\"string\"|\"latlng\"|\"latlngbounds\")} AttributeType\n * @typedef {(boolean|number|string|LatLng)} AttributeValue\n */\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst positionalArguments = (methodName) => {\n switch (methodName) {\n case \"circle\":\n return [option(\"latLng\", \"latlng\", null)];\n case \"rectangle\":\n return [option(\"latLngBounds\", \"latlngbounds\", null)];\n case \"polygon\":\n return [option(\"latLngs\", \"latlng\", null)];\n case \"polyline\":\n return [option(\"latLngs\", \"latlng\", null)];\n }\n};\n\n/**\n * @param {string} name\n * @param {AttributeType} type\n * @param {AttributeValue | null} defaultValue\n * @returns {TagOption}\n */\nconst option = (name, type, defaultValue) => {\n return {\n camel: name,\n kebab: camelToKebab(name),\n parser: inferParser(type),\n defaultValue,\n };\n};\n\n/**\n * @param {AttributeType} type\n * @returns {(s: string) => AttributeValue}\n */\nconst inferParser = (type) => {\n switch (type.toLowerCase()) {\n case \"boolean\":\n return (s) => s === \"true\";\n case \"number\":\n return parseFloat;\n case \"latlng\":\n case \"latlngbounds\":\n return JSON.parse;\n case \"string\":\n return (s) => s;\n default:\n return (s) => s;\n }\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {TagOption[]}\n */\nconst options = (methodName) => {\n const _OPTIONS = {\n circle: [option(\"radius\", \"number\", null)],\n path: [\n option(\"stroke\", \"boolean\", true),\n option(\"color\", \"string\", \"#3388ff\"),\n option(\"weight\", \"number\", 3),\n option(\"opacity\", \"number\", 1.0),\n option(\"lineCap\", \"string\", \"round\"),\n option(\"lineJoin\", \"string\", \"round\"),\n option(\"dashArray\", \"string\", null),\n option(\"dashOffset\", \"string\", null),\n option(\"fill\", \"boolean\", true),\n option(\"fillColor\", \"string\", \"#3388ff\"),\n option(\"fillOpacity\", \"number\", 0.2),\n ],\n polyline: [\n option(\"smoothFactor\", \"number\", 1.0),\n option(\"noClip\", \"boolean\", false),\n ],\n polygon: [],\n rectangle: [],\n interactiveLayer: [option(\"interactive\", \"boolean\", true)],\n };\n return inheritance(methodName).flatMap((parent) => _OPTIONS[parent]);\n};\n\n/**\n * @type {Object.<string, (MethodName | LayerName)[]>}\n */\nconst INHERITS = {\n circle: [\"path\"],\n polyline: [\"path\"],\n polygon: [\"polyline\"],\n rectangle: [\"polygon\"],\n path: [\"interactiveLayer\"],\n interactiveLayer: [],\n};\n\n/**\n * @param {MethodName} methodName\n * @returns {(MethodName | LayerName)[]}\n */\nconst inheritance = (methodName) => {\n /** @type {(MethodName | LayerName)} */\n let name = methodName;\n let chain = [methodName];\n while (INHERITS[name].length > 0) {\n let parent = INHERITS[name][0];\n chain.push(parent);\n name = parent;\n }\n return chain;\n};\n\n/**\n * @param {MethodName} methodName\n * @param {string} newValue\n * @param {string} name\n * @param {(Circle | Rectangle | Polygon | Polyline)} layer\n */\nconst setter = (layer, methodName, name, newValue) => {\n // Parse\n const allOptions = [\n ...positionalArguments(methodName),\n ...options(methodName),\n ];\n let _opt = allOptions.find((o) => o.kebab === name);\n if (typeof _opt === \"undefined\") {\n return;\n }\n const parsedValue = _opt.parser(newValue);\n\n // Update\n if (layer instanceof Circle) {\n switch (name) {\n case \"lat-lng\":\n layer.setLatLng(JSON.parse(newValue));\n break;\n case \"radius\":\n layer.setRadius(parseFloat(newValue));\n break;\n }\n } else if (layer instanceof Rectangle) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n case \"lat-lng-bounds\":\n layer.setBounds(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polygon) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n } else if (layer instanceof Polyline) {\n switch (name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue));\n break;\n }\n }\n\n // setStyle options\n let opt = options(\"polyline\").find((o) => o.kebab === name);\n if (typeof opt !== \"undefined\") {\n layer.setStyle({ [opt.camel]: parsedValue });\n }\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst attributes = (methodName) => {\n let args = positionalArguments(methodName).map((o) => o.kebab);\n let opts = options(methodName).map((o) => o.kebab);\n return [...args, ...opts];\n};\n\n/**\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {};\n\n // Process inheritance chain\n options(methodName).forEach((o) => {\n if (el.hasAttribute(o.kebab)) {\n result[o.camel] = o.parser(el.getAttribute(o.kebab));\n }\n });\n return result;\n};\n\n/**\n * Read positional arguments from HTMLElement\n *\n * @param {HTMLElement} el\n * @param {MethodName} methodName\n */\nconst positional = (el, methodName) => {\n return positionalArguments(methodName).map(option => {\n const schema = htmlAttribute(option.kebab)\n const value = parse(schema, el)\n return option.parser(value);\n })\n};\n\n/**\n * @param {MethodName} methodName\n */\nconst generator = (method, methodName) => {\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(tooltipConnected, (ev) => {\n if (this.layer !== null) {\n this.layer.bindTooltip(ev.detail.tooltip);\n }\n });\n }\n\n connectedCallback() {\n const args = positional(this, methodName);\n const options = settings(this, methodName);\n this.layer = method(...args, options);\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n /**\n * @param {string} attName\n * @param {string} newValue\n */\n attributeChangedCallback(attName, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, methodName, attName, newValue);\n }\n }\n }\n return cls;\n};\n\nexport default generator;\n","// @ts-check\n\n// Make L.markerClusterGroup optional\nimport(\"leaflet.markercluster\").catch((error) => {\n console.warn(\"Failed to import leaflet.markercluster\", error)\n});\n\nimport { layerConnected } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMarkerClusterGroup extends LLayer {\n static observedAttributes = [\n \"show-coverage-on-hover\",\n \"icon-options\"\n ];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const iconOptions = this.getAttribute(\"icon-options\");\n this.layer = L.markerClusterGroup({\n showCoverageOnHover: this.hasAttribute(\"show-coverage-on-hover\"),\n iconCreateFunction: this._createIconCreateFunction(iconOptions)\n });\n\n const event = new CustomEvent(layerConnected, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n name\n }\n });\n this.dispatchEvent(event);\n\n this.addEventListener(layerConnected, (ev) => {\n ev.stopPropagation();\n this.layer.addLayer(ev.detail.layer);\n });\n }\n\n _createIconCreateFunction(iconOptions) {\n if (iconOptions) {\n let { size, content, className } = JSON.parse(iconOptions);\n\n return (cluster) => {\n const resolvedSize = this._callClusterFunction(cluster, size);\n const resolvedContent = this._callClusterFunction(cluster, content);\n\n return L.divIcon({\n html: resolvedContent,\n className: className,\n iconSize: new L.Point(resolvedSize, resolvedSize)\n });\n };\n }\n }\n\n _callClusterFunction(cluster, body) {\n return Function(\"cluster\", `\"use strict\";return (${body})`)(cluster);\n }\n}\n\nexport default LMarkerClusterGroup;\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport LDivIcon from \"./l-div-icon.js\";\nimport LTooltip from \"./l-tooltip.js\";\nimport LPane from \"./l-pane.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\";\nimport LMarkerClusterGroup from \"./l-marker-cluster-group.js\";\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-pane\", LPane);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker-cluster-group\", LMarkerClusterGroup);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"));\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"));\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"));\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"));\n customElements.define(\"l-tooltip\", LTooltip);\n customElements.define(\"l-div-icon\", LDivIcon);\n})();\n\nexport default init;\n"],"names":["layerConnected","popupConnected","iconConnected","layerRemoved","latLngBoundsConnected","latLngBoundsChanged","tooltipConnected","paneConnected","connectLeafletEvents","el","evented","bubble","hasAttribute","on","getAttribute","split","forEach","eventName","e","dispatchEvent","CustomEvent","bubbles","detail","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","cancelable","LLayer","_this","disconnectedCallback","_this$layer","remove","LLayerGroup","_LLayer","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LeafletHTMLError","_Error","issues","key","get","JSON","stringify","Error","parse","schema","value","result","status","wrap","partial","obj","ctx","_i3","_Object$keys3","Object","keys","length","localCtx","concat","pipe","parsers","slice","arguments","i","chain","nullable","parser","optional","htmlAttribute","attributeName","htmlAttributeIssue","_extends","json","jsonIssue","option","apply","code","message","tagName","toLowerCase","LMap","map","boundsListener","method","bounds","createPane","target","_proto","_this2","L","zoomControl","whenReady","fitWorld","zoom","isNaN","center","_i2","_Object$keys2","_parse","setView","locate","attributeChangedCallback","_oldValue","newValue","setZoom","observedAttributes","LMarker","setIcon","icon","bindTooltip","tooltip","latLng","options","opacity","parseFloat","pane","closest","marker","setAttribute","stamp","openPopup","popup","bindPopup","content","setLatLng","setOpacity","LOverlayLayers","LPopup","openPopupAttribute","LTileLayer","_step","urlTemplate","templateOptions","_iterator","_createForOfIteratorHelperLoose","parseTemplateAttributes","done","attribute","paneOptions","parentElement","attribution","errorTileUrl","tileLayer","matchAll","match","LLatLngBounds","getEvent","_name","LImageOverlay","url","alt","imageOverlay","console","warn","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","geoJSON","kebabToCamel","kebab","replace","x","toUpperCase","STRING_ATTRIBUTES","JSON_ATTRIBUTES","BOOL_ATTRIBUTES","LIcon","_parseOptions","_","indexOf","update","CustomElement","html","innerHTML","className","divIcon","LTooltip","_this$getAttribute","permanent","interactive","direction","setContent","attName","positionalArguments","methodName","defaultValue","camel","s","letter","idx","join","inferParser","_OPTIONS","circle","path","polyline","polygon","rectangle","interactiveLayer","inheritance","flatMap","parent","INHERITS","push","settings","o","generator","cls","args","positional","_opt","find","parsedValue","Circle","setRadius","Rectangle","setLatLngs","Polygon","Polyline","_layer$setStyle","opt","setStyle","setter","opts","attributes","import","error","LMarkerClusterGroup","iconOptions","markerClusterGroup","showCoverageOnHover","iconCreateFunction","_createIconCreateFunction","_this3","_JSON$parse","size","cluster","resolvedSize","_callClusterFunction","resolvedContent","iconSize","Point","body","Function","init","customElements","define","LPane","LDivIcon"],"mappings":"6iEAGaA,EAAiB,oBACjBC,EAAiB,oBACjBC,EAAgB,mBAChBC,EAAe,kBACfC,EAAwB,2BACxBC,EAAsB,yBACtBC,EAAmB,sBACnBC,EAAgB,mBAOhBC,EAAuB,SAACC,EAAIC,EAASC,GAChD,QADgDA,IAAAA,IAAAA,GAAS,GACrDF,EAAGG,aAAa,MAAO,CACzB,IAAMC,EAAKJ,EAAGK,aAAa,MAChB,OAAPD,GACFA,EAAGE,MAAM,OAAOC,QAAQ,SAACC,GACP,OAAZP,GACFA,EAAQG,GAAGI,EAAW,SAACC,GACrBT,EAAGU,cACD,IAAIC,YAAYH,EAAW,CAAEI,QAASV,EAAQW,OAAQJ,IAE1D,EAEJ,EAEJ,CACF,EC7BMK,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,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GAC5B,OAAOC,SAAS,UAAS,wBAA0BD,EAAO,IAAnDC,CAAqDP,EAC9D,EAACT,CAAA,EAtD+B3N,GAA5B2N,GACG/H,mBAAqB,CAC1B,yBACA,gBCQE,IAAAgJ,IAEJC,eAAeC,OAAO,QAAS3K,GAC/B0K,eAAeC,OAAO,SAAUC,IAChCF,eAAeC,OAAO,mBAAoB3P,GAC1C0P,eAAeC,OAAO,gBAAiBtQ,GACvCqQ,eAAeC,OAAO,mBAAoB7H,IAC1C4H,eAAeC,OAAO,gBAAiBzO,GACvCwO,eAAeC,OAAO,eAAgB1H,IACtCyH,eAAeC,OAAO,yBAA0BnB,IAChDkB,eAAeC,OAAO,WAAYjJ,GAClCgJ,eAAeC,OAAO,UAAW5H,IACjC2H,eAAeC,OAAO,mBAAoB1G,IAC1CyG,eAAeC,OAAO,kBAAmBvG,IACzCsG,eAAeC,OAAO,kBAAmB/F,IACzC8F,eAAeC,OAAO,YAAa1F,IACnCyF,eAAeC,OAAO,SAAUhF,IAChC+E,eAAeC,OAAO,WAAYxC,GAAUb,EAAQ,WACpDoD,eAAeC,OAAO,aAAcxC,GAAUX,EAAU,aACxDkD,eAAeC,OAAO,YAAaxC,GAAUV,EAAS,YACtDiD,eAAeC,OAAO,cAAexC,GAAUT,EAAW,cAC1DgD,eAAeC,OAAO,YAAatE,SACnCqE,eAAeC,OAAO,aAAcE"}
|
package/package.json
CHANGED
package/dist/leaflet-html.cjs
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
var t=require("leaflet");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,e}var n=/*#__PURE__*/e(t);function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!t})()}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(r())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,e);var i=new(t.bind.apply(t,a));return n&&o(i,n.prototype),i}(t,arguments,i(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,t)},l(t)}var c="map:addTo",u="popup:add",s=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){this.addEventListener(c,function(t){t.detail.type="base"})},e}(/*#__PURE__*/l(HTMLElement)),p=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=t.control.layers({},{});this.addEventListener(c,function(t){var n=t.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?e.addOverlay(i,a):"base"===r&&e.addBaseLayer(i,a),t.preventDefault()});var n=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:e}});this.dispatchEvent(n)},n}(/*#__PURE__*/l(HTMLElement)),f=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return a(e,t),e}(/*#__PURE__*/l(HTMLElement)),h=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("name"),n=t.layerGroup();this.layer=n;var r=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:n,name:e}});this.dispatchEvent(r),this.addEventListener(c,function(t){t.stopPropagation(),n.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var e=t.getAttribute("leaflet-id");if(null!==e){var r=n.getLayer(parseInt(e));void 0!==r&&n.removeLayer(r)}}})})}).observe(this,{childList:!0})},n}(f),d=/*#__PURE__*/function(t){function e(){var n;return(n=t.call(this)||this).map=null,n.addEventListener("map:bounds",function(t){var e=t.detail;null!==n.map&&n.map[e.method](e.bounds)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof e){var n=t.target;t.removedNodes.forEach(function(t){t instanceof f&&null!==n.map&&null!==t.layer&&n.map.removeLayer(t.layer)})}})}).observe(n,{childList:!0}),n}return a(e,t),e.prototype.connectedCallback=function(){var t=this;this.map=n.map(this);var e=this.getAttribute("center"),r=this.getAttribute("zoom");null!==e&&null!==r&&this.map.setView(JSON.parse(e),parseInt(r)),this.addEventListener(c,function(e){e.detail.layer.addTo(t.map)}),this.addEventListener("layer:remove",function(e){null!==t.map&&t.map.removeLayer(e.detail.layer)})},e}(/*#__PURE__*/l(HTMLElement)),b=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e.addEventListener("icon:add",function(t){t.stopPropagation(),e.layer.setIcon(t.detail.icon)}),e}a(e,t);var r=e.prototype;return r.connectedCallback=function(){var t=this,e=JSON.parse(this.getAttribute("lat-lng")),r=parseFloat(this.getAttribute("opacity")||"1.0");if(this.layer=n.marker(e,{opacity:r}),this.hasAttribute("icon")){var a=n.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(a)}this.setAttribute("leaflet-id",n.stamp(this.layer)),this.addEventListener(u,function(e){t.layer.bindPopup(e.detail.content)});var i=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(i)},r.attributeChangedCallback=function(t,e,r){null!==this.layer&&("lat-lng"===t&&this.layer.setLatLng(JSON.parse(r)),"opacity"===t&&this.layer.setOpacity(parseFloat(r)),"icon"===t&&this.layer.setIcon(n.icon(JSON.parse(r))))},e}(f);b.observedAttributes=["lat-lng","opacity","icon"];var y=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){this.addEventListener(c,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/l(HTMLElement)),v=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=new CustomEvent(u,{cancelable:!0,bubbles:!0,detail:{content:t}});this.dispatchEvent(e)},e}(/*#__PURE__*/l(HTMLElement)),m=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("name"),n=this.getAttribute("url-template");if(null!==n){var r={},a="attribution";this.hasAttribute(a)&&(r[a]=this.getAttribute(a)),this.layer=t.tileLayer(n,r);var i=new CustomEvent(c,{detail:{name:e,layer:this.layer},bubbles:!0});this.dispatchEvent(i)}},n}(f),g=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.attributeChangedCallback=function(t,e,n){var r=new CustomEvent("map:bounds",{bubbles:!0,detail:{bounds:JSON.parse(n),method:this.getAttribute("method")||"fitBounds"}});this.dispatchEvent(r)},e}(/*#__PURE__*/l(HTMLElement));g.observedAttributes=["bounds"];var E=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}a(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this.getAttribute("url");if(null!==e){var n=this.getAttribute("bounds");if(null!==n){var r={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""};this.layer=t.imageOverlay(e,JSON.parse(n),r),this.dispatchEvent(new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},r.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},n}(f);E.observedAttributes=["url","bounds","opacity"];var L=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=JSON.parse(this.getAttribute("url")),n=JSON.parse(this.getAttribute("bounds")),r={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},a=t.videoOverlay(e,n,r);this.dispatchEvent(new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:a}}))},n}(f),O=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("geojson");if(null!==e){var n=t.geoJSON(JSON.parse(e));this.dispatchEvent(new CustomEvent(c,{bubbles:!0,cancelable:!0,detail:{layer:n}}))}},n}(/*#__PURE__*/l(HTMLElement)),C=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},A=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return a(e,t),e.prototype.connectedCallback=function(){var t=this,e={};["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"].forEach(function(n){t.hasAttribute(n)&&(e[C(n)]=t.getAttribute(n))}),["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"].forEach(function(n){t.hasAttribute(n)&&(e[C(n)]=JSON.parse(t.getAttribute(n)))}),this.hasAttribute("cross-origin")&&(e.crossOrigin="true"===this.getAttribute("cross-origin")),this.icon=n.icon(e);var r=new CustomEvent("icon:add",{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(r)},e}(/*#__PURE__*/l(HTMLElement)),w={circle:[["lat-lng",t.LatLng]],polyline:[["lat-lngs",t.LatLng]],polygon:[["lat-lng",t.LatLng]],rectangle:[["lat-lng",t.LatLng]]},k={circle:{radius:[Number,null]},polyline:{smoothFactor:[Number,1],noClip:[Boolean,!1]},polygon:{},path:{stroke:[Boolean,!0],color:[String,"#3388ff"],weight:[Number,3],opacity:[Number,1],lineCap:[String,"round"],lineJoin:[String,"round"]},layer:{},rectangle:{}},S={circle:["path","layer"],polyline:["path","layer"],polygon:["polyline"],rectangle:["path","layer"]},N=function(t){var e,n=w[t].map(function(t){return t[0]}),r=Object.keys(k[t]);return S[t].forEach(function(t){var e;(e=r).push.apply(e,Object.keys(k[t]))}),(e=r=r.map(j)).push.apply(e,n),r},j=function(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")},J=function(e,n,r){switch(n){case Number:return parseFloat(e);case Boolean:return"true"===e.toLowerCase();case String:return e;case t.LatLng:return JSON.parse(e);default:return r}},M=function(t,e){console.log(N(e));var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t}a(r,n);var i=r.prototype;return i.connectedCallback=function(){var n=function(t,e){return w[e].map(function(e){var n=e[1];return J(t.getAttribute(e[0]),n,null)})}(this,e),r=function(t,e){var n={},r=function(e){Object.entries(e).forEach(function(e){var r=e[0],a=e[1],i=a[0],o=a[1],l=j(r);t.hasAttribute(l)&&(n[r]=J(t.getAttribute(l),i,o))})};return r(k[e]),S[e].forEach(function(t){r(k[t])}),n}(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent("map:addTo",{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},i.attributeChangedCallback=function(t,e,n){null!==this.layer&&function(t,e,n){switch(e){case"lat-lngs":t.setLatLngs(JSON.parse(n));break;case"weight":t.setStyle({weight:parseInt(n)});break;case"color":t.setStyle({color:n})}}(this.layer,t,n)},r}(/*#__PURE__*/l(HTMLElement));return n.observedAttributes=N(e),n},T=(customElements.define("l-map",d),customElements.define("l-control-layers",p),customElements.define("l-base-layers",s),customElements.define("l-overlay-layers",y),customElements.define("l-layer-group",h),customElements.define("l-tile-layer",m),customElements.define("l-marker",b),customElements.define("l-popup",v),customElements.define("l-lat-lng-bounds",g),customElements.define("l-image-overlay",E),customElements.define("l-video-overlay",L),customElements.define("l-geojson",O),customElements.define("l-icon",A),customElements.define("l-circle",M(t.circle,"circle")),customElements.define("l-polyline",M(t.polyline,"polyline")),customElements.define("l-polygon",M(t.polygon,"polygon")),void customElements.define("l-rectangle",M(t.rectangle,"rectangle")));module.exports=T;
|
2
|
-
//# sourceMappingURL=leaflet-html.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"leaflet-html.cjs","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/l-icon.js","../src/generator.js","../src/index.js"],"sourcesContent":["export const mapAddTo = \"map:addTo\";\nexport const popupAdd = \"popup:add\";\nexport const layerRemove = \"layer:remove\";\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(mapAddTo, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(mapAddTo, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemove, mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMap extends HTMLElement {\n constructor() {\n super();\n\n this.map = null;\n this.addEventListener(\"map:bounds\", (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n });\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if ((el.map !== null) && (node.layer !== null)) {\n el.map.removeLayer(node.layer)\n }\n }\n })\n }\n })\n })\n observer.observe(this, { childList: true })\n }\n\n connectedCallback() {\n this.map = L.map(this);\n const center = this.getAttribute(\"center\");\n const zoom = this.getAttribute(\"zoom\");\n if (center !== null && zoom !== null) {\n this.map.setView(JSON.parse(center), parseInt(zoom));\n }\n this.addEventListener(mapAddTo, (ev) => {\n const layer = ev.detail.layer;\n layer.addTo(this.map);\n });\n\n this.addEventListener(layerRemove, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n}\n\nexport default LMap;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\nimport { mapAddTo, popupAdd } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(\"icon:add\", (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n }\n\n connectedCallback() {\n const latLng = JSON.parse(this.getAttribute(\"lat-lng\"));\n const opacity = parseFloat(this.getAttribute(\"opacity\") || \"1.0\");\n this.layer = L.marker(latLng, { opacity });\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupAdd, (ev) => {\n const { content } = ev.detail;\n this.layer.bindPopup(content);\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-marker\", LMarker);\n });\n\n it(\"default icon\", () => {\n const el = document.createElement(\"l-marker\");\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = new L.Icon.Default();\n expect(actual).toEqual(expected);\n });\n\n it(\"adds an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute before appendChild\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"foo.png\" }));\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"foo.png\" });\n expect(actual).toEqual(expected);\n });\n\n it(\"changes an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute after appendChild\n document.body.appendChild(el);\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"bar.png\" }));\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"bar.png\" });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LMarker;\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupAdd } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n const event = new CustomEvent(popupAdd, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const urlTemplate = this.getAttribute(\"url-template\");\n if (urlTemplate === null) {\n return;\n }\n const options = {};\n const key = \"attribution\";\n if (this.hasAttribute(key)) {\n options[key] = this.getAttribute(key);\n }\n this.layer = tileLayer(urlTemplate, options);\n const event = new CustomEvent(mapAddTo, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n const event = new CustomEvent(\"map:bounds\", {\n bubbles: true,\n detail: {\n bounds: JSON.parse(newValue),\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n }),\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n if (value !== null) {\n const layer = geoJSON(JSON.parse(value));\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer,\n },\n }),\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\n\nconst camelCase = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\n\nclass LIcon extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n const options = {};\n\n // Strings\n let keys = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n ];\n keys.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = this.getAttribute(key);\n }\n });\n\n // Points\n let points = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n ];\n points.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = JSON.parse(this.getAttribute(key));\n }\n });\n\n if (this.hasAttribute(\"cross-origin\")) {\n options.crossOrigin = this.getAttribute(\"cross-origin\") === \"true\";\n }\n this.icon = L.icon(options);\n\n const event = new CustomEvent(\"icon:add\", {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-icon\", LIcon);\n });\n\n it(\"default\", () => {\n const el = document.createElement(\"l-icon\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"emits icon:add event\", async () => {\n const el = document.createElement(\"l-icon\");\n let promise = new Promise((resolve) => {\n el.addEventListener(\"icon:add\", (ev) => {\n resolve(ev.detail.icon);\n });\n });\n document.body.appendChild(el);\n let actual = await promise;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"options\", () => {\n const el = document.createElement(\"l-icon\");\n el.setAttribute(\"icon-url\", \"url.png\");\n el.setAttribute(\"icon-retina-url\", \"retina.png\");\n el.setAttribute(\"icon-size\", \"[0, 0]\");\n el.setAttribute(\"icon-anchor\", \"[0, 0]\");\n el.setAttribute(\"popup-anchor\", \"[0, 0]\");\n el.setAttribute(\"tooltip-anchor\", \"[0, 0]\");\n el.setAttribute(\"shadow-url\", \"urlShadow.png\");\n el.setAttribute(\"shadow-retina-url\", \"retinaShadow.png\");\n el.setAttribute(\"shadow-size\", \"[0, 0]\");\n el.setAttribute(\"shadow-anchor\", \"[0, 0]\");\n el.setAttribute(\"class-name\", \"foo\");\n el.setAttribute(\"cross-origin\", \"true\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon({\n iconUrl: \"url.png\",\n iconRetinaUrl: \"retina.png\",\n iconSize: [0, 0],\n iconAnchor: [0, 0],\n popupAnchor: [0, 0],\n tooltipAnchor: [0, 0],\n shadowUrl: \"urlShadow.png\",\n shadowRetinaUrl: \"retinaShadow.png\",\n shadowSize: [0, 0],\n shadowAnchor: [0, 0],\n className: \"foo\",\n crossOrigin: true,\n });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LIcon;\n","import { LatLng } from \"leaflet\"\n\nconst ARGS = {\n circle: [[\"lat-lng\", LatLng]],\n polyline: [[\"lat-lngs\", LatLng]], // TODO: LatLng[] array\n polygon: [[\"lat-lng\", LatLng]],\n rectangle: [[\"lat-lng\", LatLng]],\n}\nconst OPTIONS = {\n circle: {\n radius: [Number, null]\n },\n polyline: {\n smoothFactor: [Number, 1.0],\n noClip: [Boolean, false]\n },\n polygon: {},\n path: {\n stroke: [Boolean, true],\n color: [String, \"#3388ff\"],\n weight: [Number, 3],\n opacity: [Number, 1.0],\n lineCap: [String, \"round\"],\n lineJoin: [String, \"round\"],\n },\n layer: {},\n rectangle: {}\n}\n\nconst INHERITS = {\n circle: [\"path\", \"layer\"],\n polyline: [\"path\", \"layer\"],\n polygon: [\"polyline\"],\n rectangle: [\"path\", \"layer\"],\n}\n\n// TODO: Generalise approach\nconst setter = (layer, name, newValue) => {\n switch(name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue))\n break;\n case \"weight\":\n layer.setStyle({ weight: parseInt(newValue) })\n break;\n case \"color\":\n layer.setStyle({ color: newValue })\n break;\n }\n}\n\nconst attributes = (methodName) => {\n let args = ARGS[methodName].map(x => x[0])\n let attrs = Object.keys(OPTIONS[methodName])\n INHERITS[methodName].forEach((parent) => {\n attrs.push(...Object.keys(OPTIONS[parent]))\n })\n attrs = attrs.map(camelToKebab)\n attrs.push(...args)\n return attrs\n}\n\nconst camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {} \n let process = (opts) => {\n Object.entries(opts).forEach(([key, value]) => {\n const [type, val] = value\n const attribute = camelToKebab(key)\n if (el.hasAttribute(attribute)) {\n result[key] = parse(el.getAttribute(attribute), type, val)\n }\n })\n }\n\n // Process inheritance chain\n process(OPTIONS[methodName])\n INHERITS[methodName].forEach(parent => {\n process(OPTIONS[parent])\n })\n return result\n}\n\nconst positional = (el, methodName) => {\n return ARGS[methodName].map(([key, type]) => {\n return parse(el.getAttribute(key), type, null)\n })\n}\n\nconst parse = (text, type, defaultValue) => {\n switch (type) {\n case Number:\n return parseFloat(text)\n case Boolean:\n return text.toLowerCase() === \"true\"\n case String:\n return text\n case LatLng:\n return JSON.parse(text)\n default:\n return defaultValue\n }\n}\n\nconst generator = (method, methodName) => {\n console.log(attributes(methodName))\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super()\n this.layer = null\n // TODO: event handlers\n }\n\n connectedCallback() {\n const args = positional(this, methodName)\n const options = settings(this, methodName)\n this.layer = method(...args, options)\n const event = new CustomEvent(\"map:addTo\", {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, name, newValue)\n }\n }\n }\n return cls\n}\n\n\nexport default generator\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\"\n\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"))\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"))\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"))\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"))\n})();\n\nexport default init;\n"],"names":["mapAddTo","popupAdd","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","detail","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","CustomEvent","cancelable","bubbles","dispatchEvent","LLayer","_this","LLayerGroup","_LLayer","getAttribute","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","forEach","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LMap","map","method","bounds","target","el","_this2","L","center","zoom","setView","JSON","parse","addTo","LMarker","setIcon","icon","_proto","latLng","opacity","parseFloat","marker","hasAttribute","setAttribute","stamp","bindPopup","content","attributeChangedCallback","_oldValue","newValue","setLatLng","setOpacity","observedAttributes","LOverlayLayers","LPopup","LTileLayer","urlTemplate","options","key","tileLayer","LLatLngBounds","_name","LImageOverlay","url","alt","imageOverlay","console","warn","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","value","geoJSON","camelCase","kebab","replace","x","toUpperCase","LIcon","crossOrigin","ARGS","circle","LatLng","polyline","polygon","rectangle","OPTIONS","radius","Number","smoothFactor","noClip","Boolean","path","stroke","color","String","weight","lineCap","lineJoin","INHERITS","attributes","methodName","_attrs2","args","attrs","Object","keys","parent","_attrs","push","apply","camelToKebab","s","split","letter","idx","toLowerCase","join","text","defaultValue","generator","log","cls","_ref2","positional","result","process","opts","entries","_ref","val","attribute","settings","concat","_","setLatLngs","setStyle","setter","init","customElements","define"],"mappings":"m/CAAaA,EAAW,YACXC,EAAW,YCElBC,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,EAAAC,GAAAD,EAAAK,UAEDC,kBAAA,WACEH,KAAKI,iBAAiBT,EAAU,SAACU,GAC/BA,EAAGC,OAAa,KAAI,MACtB,EACF,EAACT,CAAA,CATcC,cASdS,EATuBC,cCEpBC,eAAc,SAAAX,GAClB,SAAAW,IAAc,OACZX,EAAAC,KAAMC,WACR,CA2BC,OA3BAC,EAAAQ,EAAAX,GAAAW,EAAAP,UAEDC,kBAAA,WAEE,IAGMO,EAAgBC,UAAQC,OAHjB,CAAA,EAEG,CAAE,GAGlBZ,KAAKI,iBAAiBT,EAAU,SAACU,GAC/B,IAAAQ,EAA8BR,EAAGC,OAAzBQ,EAAID,EAAJC,KAAMC,EAAIF,EAAJE,KAAMC,EAAKH,EAALG,MACP,YAATF,EACFJ,EAAcO,WAAWD,EAAOD,GACd,SAATD,GACTJ,EAAcQ,aAAaF,EAAOD,GAEpCV,EAAGc,gBACL,GAEA,IAAMC,EAAQ,IAAIC,YAAY1B,EAAU,CACtC2B,YAAY,EACZC,SAAS,EACTjB,OAAQ,CACNU,MAAON,KAGXV,KAAKwB,cAAcJ,EACrB,EAACX,CAAA,CA9BiB,cA8BjBF,EA9B0BC,cCLvBiB,eAAM3B,SAAAA,GACV,SAAA2B,IAAcC,I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AO,YAAatE,GACnCqE,eAAeC,OAAO,SAAU9D,GAChC6D,eAAeC,OAAO,WAAYpB,EAAUvC,EAAAA,OAAQ,WACpD0D,eAAeC,OAAO,aAAcpB,EAAUrC,EAAAA,SAAU,aACxDwD,eAAeC,OAAO,YAAapB,EAAUpC,UAAS,iBACtDuD,eAAeC,OAAO,cAAepB,EAAUnC,EAAAA,UAAW"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import*as t from"leaflet";import{control as e,layerGroup as n,tileLayer as s,imageOverlay as a,videoOverlay as l,geoJSON as o,LatLng as i,circle as r,polyline as c,polygon as u,rectangle as d}from"leaflet";const h="map:addTo",p="popup:add";class b extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener(h,t=>{t.detail.type="base"})}}class m extends HTMLElement{constructor(){super()}connectedCallback(){const t=e.layers({},{});this.addEventListener(h,e=>{const{type:n,name:s,layer:a}=e.detail;"overlay"===n?t.addOverlay(a,s):"base"===n&&t.addBaseLayer(a,s),e.preventDefault()});const n=new CustomEvent(h,{cancelable:!0,bubbles:!0,detail:{layer:t}});this.dispatchEvent(n)}}class y extends HTMLElement{constructor(){super(),this.layer=null}}class g extends HTMLElement{constructor(){super(),this.map=null,this.addEventListener("map:bounds",t=>{const{bounds:e,method:n}=t.detail;null!==this.map&&this.map[n](e)}),new MutationObserver(function(t){t.forEach(t=>{if(t.target instanceof g){const e=t.target;t.removedNodes.forEach(t=>{t instanceof y&&null!==e.map&&null!==t.layer&&e.map.removeLayer(t.layer)})}})}).observe(this,{childList:!0})}connectedCallback(){this.map=t.map(this);const e=this.getAttribute("center"),n=this.getAttribute("zoom");null!==e&&null!==n&&this.map.setView(JSON.parse(e),parseInt(n)),this.addEventListener(h,t=>{t.detail.layer.addTo(this.map)}),this.addEventListener("layer:remove",t=>{null!==this.map&&this.map.removeLayer(t.detail.layer)})}}class E extends y{constructor(){super(),this.layer=null,this.addEventListener("icon:add",t=>{t.stopPropagation(),this.layer.setIcon(t.detail.icon)})}connectedCallback(){const e=JSON.parse(this.getAttribute("lat-lng")),n=parseFloat(this.getAttribute("opacity")||"1.0");if(this.layer=t.marker(e,{opacity:n}),this.hasAttribute("icon")){const e=t.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(e)}this.setAttribute("leaflet-id",t.stamp(this.layer)),this.addEventListener(p,t=>{const{content:e}=t.detail;this.layer.bindPopup(e)});const s=new CustomEvent(h,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(s)}attributeChangedCallback(e,n,s){null!==this.layer&&("lat-lng"===e&&this.layer.setLatLng(JSON.parse(s)),"opacity"===e&&this.layer.setOpacity(parseFloat(s)),"icon"===e&&this.layer.setIcon(t.icon(JSON.parse(s))))}}if(E.observedAttributes=["lat-lng","opacity","icon"],import.meta.vitest){const{it:e,expect:n,beforeAll:s}=import.meta.vitest;s(()=>{customElements.define("l-marker",E)}),e("default icon",()=>{const e=document.createElement("l-marker");document.body.appendChild(e);let s=e.layer.getIcon(),a=new t.Icon.Default;n(s).toEqual(a)}),e("adds an icon",()=>{const e=document.createElement("l-marker");e.setAttribute("icon",JSON.stringify({iconUrl:"foo.png"})),document.body.appendChild(e);let s=e.layer.getIcon(),a=t.icon({iconUrl:"foo.png"});n(s).toEqual(a)}),e("changes an icon",()=>{const e=document.createElement("l-marker");document.body.appendChild(e),e.setAttribute("icon",JSON.stringify({iconUrl:"bar.png"}));let s=e.layer.getIcon(),a=t.icon({iconUrl:"bar.png"});n(s).toEqual(a)})}class f extends HTMLElement{constructor(){super()}connectedCallback(){this.addEventListener(h,t=>{t.detail.type="overlay"})}}class v extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("content"),e=new CustomEvent(p,{cancelable:!0,bubbles:!0,detail:{content:t}});this.dispatchEvent(e)}}class A extends HTMLElement{constructor(){super()}attributeChangedCallback(t,e,n){const s=new CustomEvent("map:bounds",{bubbles:!0,detail:{bounds:JSON.parse(n),method:this.getAttribute("method")||"fitBounds"}});this.dispatchEvent(s)}}A.observedAttributes=["bounds"];class C extends y{constructor(){super(),this.layer=null}connectedCallback(){const t=this.getAttribute("url");if(null===t)return void console.warn("attribute 'url' not set");let e=this.getAttribute("bounds");if(null===e)return void console.warn("attribute 'bounds' not set");const n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""};this.layer=a(t,JSON.parse(e),n),this.dispatchEvent(new CustomEvent(h,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}attributeChangedCallback(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))}}C.observedAttributes=["url","bounds","opacity"];class w extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("geojson");if(null!==t){const e=o(JSON.parse(t));this.dispatchEvent(new CustomEvent(h,{bubbles:!0,cancelable:!0,detail:{layer:e}}))}}}const L=t=>t.replace(/-./g,t=>t[1].toUpperCase());class k extends HTMLElement{constructor(){super(),this.icon=null}connectedCallback(){const e={};["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"].forEach(t=>{this.hasAttribute(t)&&(e[L(t)]=this.getAttribute(t))}),["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"].forEach(t=>{this.hasAttribute(t)&&(e[L(t)]=JSON.parse(this.getAttribute(t)))}),this.hasAttribute("cross-origin")&&(e.crossOrigin="true"===this.getAttribute("cross-origin")),this.icon=t.icon(e);const n=new CustomEvent("icon:add",{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(n)}}if(import.meta.vitest){const{it:e,expect:n,beforeAll:s}=import.meta.vitest;s(()=>{customElements.define("l-icon",k)}),e("default",()=>{const e=document.createElement("l-icon");document.body.appendChild(e);let s=e.icon,a=t.icon();n(s).toEqual(a)}),e("emits icon:add event",async()=>{const e=document.createElement("l-icon");let s=new Promise(t=>{e.addEventListener("icon:add",e=>{t(e.detail.icon)})});document.body.appendChild(e);let a=await s,l=t.icon();n(a).toEqual(l)}),e("options",()=>{const e=document.createElement("l-icon");e.setAttribute("icon-url","url.png"),e.setAttribute("icon-retina-url","retina.png"),e.setAttribute("icon-size","[0, 0]"),e.setAttribute("icon-anchor","[0, 0]"),e.setAttribute("popup-anchor","[0, 0]"),e.setAttribute("tooltip-anchor","[0, 0]"),e.setAttribute("shadow-url","urlShadow.png"),e.setAttribute("shadow-retina-url","retinaShadow.png"),e.setAttribute("shadow-size","[0, 0]"),e.setAttribute("shadow-anchor","[0, 0]"),e.setAttribute("class-name","foo"),e.setAttribute("cross-origin","true"),document.body.appendChild(e);let s=e.icon,a=t.icon({iconUrl:"url.png",iconRetinaUrl:"retina.png",iconSize:[0,0],iconAnchor:[0,0],popupAnchor:[0,0],tooltipAnchor:[0,0],shadowUrl:"urlShadow.png",shadowRetinaUrl:"retinaShadow.png",shadowSize:[0,0],shadowAnchor:[0,0],className:"foo",crossOrigin:!0});n(s).toEqual(a)})}const S={circle:[["lat-lng",i]],polyline:[["lat-lngs",i]],polygon:[["lat-lng",i]],rectangle:[["lat-lng",i]]},O={circle:{radius:[Number,null]},polyline:{smoothFactor:[Number,1],noClip:[Boolean,!1]},polygon:{},path:{stroke:[Boolean,!0],color:[String,"#3388ff"],weight:[Number,3],opacity:[Number,1],lineCap:[String,"round"],lineJoin:[String,"round"]},layer:{},rectangle:{}},N={circle:["path","layer"],polyline:["path","layer"],polygon:["polyline"],rectangle:["path","layer"]},x=t=>{let e=S[t].map(t=>t[0]),n=Object.keys(O[t]);return N[t].forEach(t=>{n.push(...Object.keys(O[t]))}),n=n.map(J),n.push(...e),n},J=t=>t.split("").map((t,e)=>t.toUpperCase()===t?`${0!==e?"-":""}${t.toLowerCase()}`:t).join(""),T=(t,e,n)=>{switch(e){case Number:return parseFloat(t);case Boolean:return"true"===t.toLowerCase();case String:return t;case i:return JSON.parse(t);default:return n}},M=(t,e)=>{console.log(x(e));class n extends HTMLElement{constructor(){super(),this.layer=null}connectedCallback(){const n=((t,e)=>S[e].map(([e,n])=>T(t.getAttribute(e),n,null)))(this,e),s=((t,e)=>{let n={},s=e=>{Object.entries(e).forEach(([e,s])=>{const[a,l]=s,o=J(e);t.hasAttribute(o)&&(n[e]=T(t.getAttribute(o),a,l))})};return s(O[e]),N[e].forEach(t=>{s(O[t])}),n})(this,e);this.layer=t(...n,s);const a=new CustomEvent("map:addTo",{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)}attributeChangedCallback(t,e,n){null!==this.layer&&((t,e,n)=>{switch(e){case"lat-lngs":t.setLatLngs(JSON.parse(n));break;case"weight":t.setStyle({weight:parseInt(n)});break;case"color":t.setStyle({color:n})}})(this.layer,t,n)}}return n.observedAttributes=x(e),n},H=(customElements.define("l-map",g),customElements.define("l-control-layers",m),customElements.define("l-base-layers",b),customElements.define("l-overlay-layers",f),customElements.define("l-layer-group",class extends y{constructor(){super(),this.layer=null}connectedCallback(){const t=this.getAttribute("name"),e=n();this.layer=e;const s=new CustomEvent(h,{cancelable:!0,bubbles:!0,detail:{layer:e,name:t}});this.dispatchEvent(s),this.addEventListener(h,t=>{t.stopPropagation(),e.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(t=>{t.removedNodes.forEach(t=>{if(t instanceof HTMLElement){const n=t.getAttribute("leaflet-id");if(null!==n){const t=e.getLayer(parseInt(n));void 0!==t&&e.removeLayer(t)}}})})}).observe(this,{childList:!0})}}),customElements.define("l-tile-layer",class extends y{constructor(){super(),this.layer=null}connectedCallback(){const t=this.getAttribute("name"),e=this.getAttribute("url-template");if(null===e)return;const n={},a="attribution";this.hasAttribute(a)&&(n[a]=this.getAttribute(a)),this.layer=s(e,n);const l=new CustomEvent(h,{detail:{name:t,layer:this.layer},bubbles:!0});this.dispatchEvent(l)}}),customElements.define("l-marker",E),customElements.define("l-popup",v),customElements.define("l-lat-lng-bounds",A),customElements.define("l-image-overlay",C),customElements.define("l-video-overlay",class extends y{constructor(){super()}connectedCallback(){const t=JSON.parse(this.getAttribute("url")),e=JSON.parse(this.getAttribute("bounds")),n={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},s=l(t,e,n);this.dispatchEvent(new CustomEvent(h,{cancelable:!0,bubbles:!0,detail:{layer:s}}))}}),customElements.define("l-geojson",w),customElements.define("l-icon",k),customElements.define("l-circle",M(r,"circle")),customElements.define("l-polyline",M(c,"polyline")),customElements.define("l-polygon",M(u,"polygon")),void customElements.define("l-rectangle",M(d,"rectangle")));export{H as default};
|
2
|
-
//# sourceMappingURL=leaflet-html.modern.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"leaflet-html.modern.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-geojson.js","../src/l-icon.js","../src/generator.js","../src/index.js","../src/l-layer-group.js","../src/l-tile-layer.js","../src/l-video-overlay.js"],"sourcesContent":["export const mapAddTo = \"map:addTo\";\nexport const popupAdd = \"popup:add\";\nexport const layerRemove = \"layer:remove\";\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(mapAddTo, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemove, mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMap extends HTMLElement {\n constructor() {\n super();\n\n this.map = null;\n this.addEventListener(\"map:bounds\", (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n });\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if ((el.map !== null) && (node.layer !== null)) {\n el.map.removeLayer(node.layer)\n }\n }\n })\n }\n })\n })\n observer.observe(this, { childList: true })\n }\n\n connectedCallback() {\n this.map = L.map(this);\n const center = this.getAttribute(\"center\");\n const zoom = this.getAttribute(\"zoom\");\n if (center !== null && zoom !== null) {\n this.map.setView(JSON.parse(center), parseInt(zoom));\n }\n this.addEventListener(mapAddTo, (ev) => {\n const layer = ev.detail.layer;\n layer.addTo(this.map);\n });\n\n this.addEventListener(layerRemove, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n}\n\nexport default LMap;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\nimport { mapAddTo, popupAdd } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(\"icon:add\", (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n }\n\n connectedCallback() {\n const latLng = JSON.parse(this.getAttribute(\"lat-lng\"));\n const opacity = parseFloat(this.getAttribute(\"opacity\") || \"1.0\");\n this.layer = L.marker(latLng, { opacity });\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupAdd, (ev) => {\n const { content } = ev.detail;\n this.layer.bindPopup(content);\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-marker\", LMarker);\n });\n\n it(\"default icon\", () => {\n const el = document.createElement(\"l-marker\");\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = new L.Icon.Default();\n expect(actual).toEqual(expected);\n });\n\n it(\"adds an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute before appendChild\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"foo.png\" }));\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"foo.png\" });\n expect(actual).toEqual(expected);\n });\n\n it(\"changes an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute after appendChild\n document.body.appendChild(el);\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"bar.png\" }));\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"bar.png\" });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LMarker;\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupAdd } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n const event = new CustomEvent(popupAdd, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n const event = new CustomEvent(\"map:bounds\", {\n bubbles: true,\n detail: {\n bounds: JSON.parse(newValue),\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n }),\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n if (value !== null) {\n const layer = geoJSON(JSON.parse(value));\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer,\n },\n }),\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\n\nconst camelCase = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\n\nclass LIcon extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n const options = {};\n\n // Strings\n let keys = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n ];\n keys.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = this.getAttribute(key);\n }\n });\n\n // Points\n let points = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n ];\n points.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = JSON.parse(this.getAttribute(key));\n }\n });\n\n if (this.hasAttribute(\"cross-origin\")) {\n options.crossOrigin = this.getAttribute(\"cross-origin\") === \"true\";\n }\n this.icon = L.icon(options);\n\n const event = new CustomEvent(\"icon:add\", {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-icon\", LIcon);\n });\n\n it(\"default\", () => {\n const el = document.createElement(\"l-icon\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"emits icon:add event\", async () => {\n const el = document.createElement(\"l-icon\");\n let promise = new Promise((resolve) => {\n el.addEventListener(\"icon:add\", (ev) => {\n resolve(ev.detail.icon);\n });\n });\n document.body.appendChild(el);\n let actual = await promise;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"options\", () => {\n const el = document.createElement(\"l-icon\");\n el.setAttribute(\"icon-url\", \"url.png\");\n el.setAttribute(\"icon-retina-url\", \"retina.png\");\n el.setAttribute(\"icon-size\", \"[0, 0]\");\n el.setAttribute(\"icon-anchor\", \"[0, 0]\");\n el.setAttribute(\"popup-anchor\", \"[0, 0]\");\n el.setAttribute(\"tooltip-anchor\", \"[0, 0]\");\n el.setAttribute(\"shadow-url\", \"urlShadow.png\");\n el.setAttribute(\"shadow-retina-url\", \"retinaShadow.png\");\n el.setAttribute(\"shadow-size\", \"[0, 0]\");\n el.setAttribute(\"shadow-anchor\", \"[0, 0]\");\n el.setAttribute(\"class-name\", \"foo\");\n el.setAttribute(\"cross-origin\", \"true\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon({\n iconUrl: \"url.png\",\n iconRetinaUrl: \"retina.png\",\n iconSize: [0, 0],\n iconAnchor: [0, 0],\n popupAnchor: [0, 0],\n tooltipAnchor: [0, 0],\n shadowUrl: \"urlShadow.png\",\n shadowRetinaUrl: \"retinaShadow.png\",\n shadowSize: [0, 0],\n shadowAnchor: [0, 0],\n className: \"foo\",\n crossOrigin: true,\n });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LIcon;\n","import { LatLng } from \"leaflet\"\n\nconst ARGS = {\n circle: [[\"lat-lng\", LatLng]],\n polyline: [[\"lat-lngs\", LatLng]], // TODO: LatLng[] array\n polygon: [[\"lat-lng\", LatLng]],\n rectangle: [[\"lat-lng\", LatLng]],\n}\nconst OPTIONS = {\n circle: {\n radius: [Number, null]\n },\n polyline: {\n smoothFactor: [Number, 1.0],\n noClip: [Boolean, false]\n },\n polygon: {},\n path: {\n stroke: [Boolean, true],\n color: [String, \"#3388ff\"],\n weight: [Number, 3],\n opacity: [Number, 1.0],\n lineCap: [String, \"round\"],\n lineJoin: [String, \"round\"],\n },\n layer: {},\n rectangle: {}\n}\n\nconst INHERITS = {\n circle: [\"path\", \"layer\"],\n polyline: [\"path\", \"layer\"],\n polygon: [\"polyline\"],\n rectangle: [\"path\", \"layer\"],\n}\n\n// TODO: Generalise approach\nconst setter = (layer, name, newValue) => {\n switch(name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue))\n break;\n case \"weight\":\n layer.setStyle({ weight: parseInt(newValue) })\n break;\n case \"color\":\n layer.setStyle({ color: newValue })\n break;\n }\n}\n\nconst attributes = (methodName) => {\n let args = ARGS[methodName].map(x => x[0])\n let attrs = Object.keys(OPTIONS[methodName])\n INHERITS[methodName].forEach((parent) => {\n attrs.push(...Object.keys(OPTIONS[parent]))\n })\n attrs = attrs.map(camelToKebab)\n attrs.push(...args)\n return attrs\n}\n\nconst camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {} \n let process = (opts) => {\n Object.entries(opts).forEach(([key, value]) => {\n const [type, val] = value\n const attribute = camelToKebab(key)\n if (el.hasAttribute(attribute)) {\n result[key] = parse(el.getAttribute(attribute), type, val)\n }\n })\n }\n\n // Process inheritance chain\n process(OPTIONS[methodName])\n INHERITS[methodName].forEach(parent => {\n process(OPTIONS[parent])\n })\n return result\n}\n\nconst positional = (el, methodName) => {\n return ARGS[methodName].map(([key, type]) => {\n return parse(el.getAttribute(key), type, null)\n })\n}\n\nconst parse = (text, type, defaultValue) => {\n switch (type) {\n case Number:\n return parseFloat(text)\n case Boolean:\n return text.toLowerCase() === \"true\"\n case String:\n return text\n case LatLng:\n return JSON.parse(text)\n default:\n return defaultValue\n }\n}\n\nconst generator = (method, methodName) => {\n console.log(attributes(methodName))\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super()\n this.layer = null\n // TODO: event handlers\n }\n\n connectedCallback() {\n const args = positional(this, methodName)\n const options = settings(this, methodName)\n this.layer = method(...args, options)\n const event = new CustomEvent(\"map:addTo\", {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, name, newValue)\n }\n }\n }\n return cls\n}\n\n\nexport default generator\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\"\n\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"))\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"))\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"))\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"))\n})();\n\nexport default init;\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(mapAddTo, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const urlTemplate = this.getAttribute(\"url-template\");\n if (urlTemplate === null) {\n return;\n }\n const options = {};\n const key = \"attribution\";\n if (this.hasAttribute(key)) {\n options[key] = this.getAttribute(key);\n }\n this.layer = tileLayer(urlTemplate, options);\n const event = new CustomEvent(mapAddTo, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n"],"names":["mapAddTo","popupAdd","LBaseLayers","HTMLElement","constructor","super","connectedCallback","this","addEventListener","ev","detail","LControlLayers","controlLayers","control","layers","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","CustomEvent","cancelable","bubbles","dispatchEvent","LLayer","LMap","map","bounds","method","MutationObserver","mutations","forEach","mutation","target","el","removedNodes","node","removeLayer","observe","childList","L","center","getAttribute","zoom","setView","JSON","parse","parseInt","addTo","LMarker","stopPropagation","setIcon","icon","latLng","opacity","parseFloat","marker","hasAttribute","setAttribute","stamp","content","bindPopup","attributeChangedCallback","_oldValue","newValue","setLatLng","setOpacity","observedAttributes","vitest","it","expect","beforeAll","customElements","define","document","createElement","body","appendChild","actual","getIcon","expected","Icon","Default","toEqual","stringify","iconUrl","LOverlayLayers","LPopup","LLatLngBounds","_name","LImageOverlay","url","console","warn","options","alt","imageOverlay","setUrl","setBounds","LGeoJSON","value","geoJSON","camelCase","kebab","replace","x","toUpperCase","LIcon","key","crossOrigin","async","promise","Promise","resolve","iconRetinaUrl","iconSize","iconAnchor","popupAnchor","tooltipAnchor","shadowUrl","shadowRetinaUrl","shadowSize","shadowAnchor","className","ARGS","circle","LatLng","polyline","polygon","rectangle","OPTIONS","radius","Number","smoothFactor","noClip","Boolean","path","stroke","color","String","weight","lineCap","lineJoin","INHERITS","attributes","methodName","args","attrs","Object","keys","parent","push","camelToKebab","s","split","letter","idx","toLowerCase","join","text","defaultValue","generator","log","cls","positional","settings","result","process","opts","entries","val","attribute","_","setter","setLatLngs","setStyle","init","group","layerGroup","addLayer","leafletId","getLayer","urlTemplate","tileLayer","autoplay","muted","playsInline","videoOverlay"],"mappings":"oNAAaA,EAAW,YACXC,EAAW,YCExB,MAAMC,UAAoBC,YACxBC,WAAAA,GACEC,OACF,CAEAC,iBAAAA,GACEC,KAAKC,iBAAiBR,EAAWS,IAC/BA,EAAGC,OAAa,KAAI,MACtB,EACF,ECPF,MAAMC,UAAuBR,YAC3BC,WAAAA,GACEC,OACF,CAEAC,iBAAAA,GAEE,MAGMM,EAAgBC,EAAQC,OAHjB,CAAE,EAEC,CAAA,GAGhBP,KAAKC,iBAAiBR,EAAWS,IAC/B,MAAMM,KAAEA,EAAIC,KAAEA,EAAIC,MAAEA,GAAUR,EAAGC,OACpB,YAATK,EACFH,EAAcM,WAAWD,EAAOD,GACd,SAATD,GACTH,EAAcO,aAAaF,EAAOD,GAEpCP,EAAGW,gBAAc,GAGnB,MAAMC,EAAQ,IAAIC,YAAYtB,EAAU,CACtCuB,YAAY,EACZC,SAAS,EACTd,OAAQ,CACNO,MAAOL,KAGXL,KAAKkB,cAAcJ,EACrB,ECnCF,MAAMK,UAAevB,YACnBC,WAAAA,GACEC,QACAE,KAAKU,MAAQ,IACf,ECCF,MAAMU,UAAaxB,YACjBC,WAAAA,GACEC,QAEAE,KAAKqB,IAAM,KACXrB,KAAKC,iBAAiB,a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Q,WACpDrD,eAAeC,OAAO,aAAcwF,EAAUlC,EAAU,aACxDvD,eAAeC,OAAO,YAAawF,EAAUjC,EAAS,iBACtDxD,eAAeC,OAAO,cAAewF,EAAUhC,EAAW"}
|
package/dist/leaflet-html.umd.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],e):(t||self).leafletHtml=e(t.leaflet)}(this,function(t){function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,e}var n=/*#__PURE__*/e(t);function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!t})()}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(r())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,e);var i=new(t.bind.apply(t,a));return n&&o(i,n.prototype),i}(t,arguments,i(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,t)},l(t)}var c="map:addTo",u="popup:add",s=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){this.addEventListener(c,function(t){t.detail.type="base"})},e}(/*#__PURE__*/l(HTMLElement)),p=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=t.control.layers({},{});this.addEventListener(c,function(t){var n=t.detail,r=n.type,a=n.name,i=n.layer;"overlay"===r?e.addOverlay(i,a):"base"===r&&e.addBaseLayer(i,a),t.preventDefault()});var n=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:e}});this.dispatchEvent(n)},n}(/*#__PURE__*/l(HTMLElement)),f=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e}return a(e,t),e}(/*#__PURE__*/l(HTMLElement)),h=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("name"),n=t.layerGroup();this.layer=n;var r=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:n,name:e}});this.dispatchEvent(r),this.addEventListener(c,function(t){t.stopPropagation(),n.addLayer(t.detail.layer)}),new MutationObserver(function(t){t.forEach(function(t){t.removedNodes.forEach(function(t){if(t instanceof HTMLElement){var e=t.getAttribute("leaflet-id");if(null!==e){var r=n.getLayer(parseInt(e));void 0!==r&&n.removeLayer(r)}}})})}).observe(this,{childList:!0})},n}(f),d=/*#__PURE__*/function(t){function e(){var n;return(n=t.call(this)||this).map=null,n.addEventListener("map:bounds",function(t){var e=t.detail;null!==n.map&&n.map[e.method](e.bounds)}),new MutationObserver(function(t){t.forEach(function(t){if(t.target instanceof e){var n=t.target;t.removedNodes.forEach(function(t){t instanceof f&&null!==n.map&&null!==t.layer&&n.map.removeLayer(t.layer)})}})}).observe(n,{childList:!0}),n}return a(e,t),e.prototype.connectedCallback=function(){var t=this;this.map=n.map(this);var e=this.getAttribute("center"),r=this.getAttribute("zoom");null!==e&&null!==r&&this.map.setView(JSON.parse(e),parseInt(r)),this.addEventListener(c,function(e){e.detail.layer.addTo(t.map)}),this.addEventListener("layer:remove",function(e){null!==t.map&&t.map.removeLayer(e.detail.layer)})},e}(/*#__PURE__*/l(HTMLElement)),b=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).layer=null,e.addEventListener("icon:add",function(t){t.stopPropagation(),e.layer.setIcon(t.detail.icon)}),e}a(e,t);var r=e.prototype;return r.connectedCallback=function(){var t=this,e=JSON.parse(this.getAttribute("lat-lng")),r=parseFloat(this.getAttribute("opacity")||"1.0");if(this.layer=n.marker(e,{opacity:r}),this.hasAttribute("icon")){var a=n.icon(JSON.parse(this.getAttribute("icon")));this.layer.setIcon(a)}this.setAttribute("leaflet-id",n.stamp(this.layer)),this.addEventListener(u,function(e){t.layer.bindPopup(e.detail.content)});var i=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(i)},r.attributeChangedCallback=function(t,e,r){null!==this.layer&&("lat-lng"===t&&this.layer.setLatLng(JSON.parse(r)),"opacity"===t&&this.layer.setOpacity(parseFloat(r)),"icon"===t&&this.layer.setIcon(n.icon(JSON.parse(r))))},e}(f);b.observedAttributes=["lat-lng","opacity","icon"];var y=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){this.addEventListener(c,function(t){t.detail.type="overlay"})},e}(/*#__PURE__*/l(HTMLElement)),v=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.connectedCallback=function(){var t=this.getAttribute("content"),e=new CustomEvent(u,{cancelable:!0,bubbles:!0,detail:{content:t}});this.dispatchEvent(e)},e}(/*#__PURE__*/l(HTMLElement)),m=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("name"),n=this.getAttribute("url-template");if(null!==n){var r={},a="attribution";this.hasAttribute(a)&&(r[a]=this.getAttribute(a)),this.layer=t.tileLayer(n,r);var i=new CustomEvent(c,{detail:{name:e,layer:this.layer},bubbles:!0});this.dispatchEvent(i)}},n}(f),g=/*#__PURE__*/function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.attributeChangedCallback=function(t,e,n){var r=new CustomEvent("map:bounds",{bubbles:!0,detail:{bounds:JSON.parse(n),method:this.getAttribute("method")||"fitBounds"}});this.dispatchEvent(r)},e}(/*#__PURE__*/l(HTMLElement));g.observedAttributes=["bounds"];var E=/*#__PURE__*/function(e){function n(){var t;return(t=e.call(this)||this).layer=null,t}a(n,e);var r=n.prototype;return r.connectedCallback=function(){var e=this.getAttribute("url");if(null!==e){var n=this.getAttribute("bounds");if(null!==n){var r={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||""};this.layer=t.imageOverlay(e,JSON.parse(n),r),this.dispatchEvent(new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:this.layer}}))}else console.warn("attribute 'bounds' not set")}else console.warn("attribute 'url' not set")},r.attributeChangedCallback=function(t,e,n){null!==this.layer&&("url"===t?this.layer.setUrl(n):"bounds"===t?this.layer.setBounds(JSON.parse(n)):"opacity"===t&&this.layer.setOpacity(parseFloat(n)))},n}(f);E.observedAttributes=["url","bounds","opacity"];var L=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=JSON.parse(this.getAttribute("url")),n=JSON.parse(this.getAttribute("bounds")),r={opacity:parseFloat(this.getAttribute("opacity")||"1.0"),alt:this.getAttribute("alt")||"",autoplay:!0,muted:!0,playsInline:!0},a=t.videoOverlay(e,n,r);this.dispatchEvent(new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:{layer:a}}))},n}(f),O=/*#__PURE__*/function(e){function n(){return e.call(this)||this}return a(n,e),n.prototype.connectedCallback=function(){var e=this.getAttribute("geojson");if(null!==e){var n=t.geoJSON(JSON.parse(e));this.dispatchEvent(new CustomEvent(c,{bubbles:!0,cancelable:!0,detail:{layer:n}}))}},n}(/*#__PURE__*/l(HTMLElement)),C=function(t){return t.replace(/-./g,function(t){return t[1].toUpperCase()})},A=/*#__PURE__*/function(t){function e(){var e;return(e=t.call(this)||this).icon=null,e}return a(e,t),e.prototype.connectedCallback=function(){var t=this,e={};["icon-url","icon-retina-url","shadow-url","shadow-retina-url","class-name"].forEach(function(n){t.hasAttribute(n)&&(e[C(n)]=t.getAttribute(n))}),["icon-anchor","icon-size","shadow-anchor","shadow-size","tooltip-anchor","popup-anchor"].forEach(function(n){t.hasAttribute(n)&&(e[C(n)]=JSON.parse(t.getAttribute(n)))}),this.hasAttribute("cross-origin")&&(e.crossOrigin="true"===this.getAttribute("cross-origin")),this.icon=n.icon(e);var r=new CustomEvent("icon:add",{cancelable:!0,bubbles:!0,detail:{icon:this.icon}});this.dispatchEvent(r)},e}(/*#__PURE__*/l(HTMLElement)),w={circle:[["lat-lng",t.LatLng]],polyline:[["lat-lngs",t.LatLng]],polygon:[["lat-lng",t.LatLng]],rectangle:[["lat-lng",t.LatLng]]},k={circle:{radius:[Number,null]},polyline:{smoothFactor:[Number,1],noClip:[Boolean,!1]},polygon:{},path:{stroke:[Boolean,!0],color:[String,"#3388ff"],weight:[Number,3],opacity:[Number,1],lineCap:[String,"round"],lineJoin:[String,"round"]},layer:{},rectangle:{}},S={circle:["path","layer"],polyline:["path","layer"],polygon:["polyline"],rectangle:["path","layer"]},N=function(t){var e,n=w[t].map(function(t){return t[0]}),r=Object.keys(k[t]);return S[t].forEach(function(t){var e;(e=r).push.apply(e,Object.keys(k[t]))}),(e=r=r.map(j)).push.apply(e,n),r},j=function(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")},T=function(e,n,r){switch(n){case Number:return parseFloat(e);case Boolean:return"true"===e.toLowerCase();case String:return e;case t.LatLng:return JSON.parse(e);default:return r}},J=function(t,e){console.log(N(e));var n=/*#__PURE__*/function(n){function r(){var t;return(t=n.call(this)||this).layer=null,t}a(r,n);var i=r.prototype;return i.connectedCallback=function(){var n=function(t,e){return w[e].map(function(e){var n=e[1];return T(t.getAttribute(e[0]),n,null)})}(this,e),r=function(t,e){var n={},r=function(e){Object.entries(e).forEach(function(e){var r=e[0],a=e[1],i=a[0],o=a[1],l=j(r);t.hasAttribute(l)&&(n[r]=T(t.getAttribute(l),i,o))})};return r(k[e]),S[e].forEach(function(t){r(k[t])}),n}(this,e);this.layer=t.apply(void 0,n.concat([r]));var a=new CustomEvent("map:addTo",{cancelable:!0,bubbles:!0,detail:{layer:this.layer}});this.dispatchEvent(a)},i.attributeChangedCallback=function(t,e,n){null!==this.layer&&function(t,e,n){switch(e){case"lat-lngs":t.setLatLngs(JSON.parse(n));break;case"weight":t.setStyle({weight:parseInt(n)});break;case"color":t.setStyle({color:n})}}(this.layer,t,n)},r}(/*#__PURE__*/l(HTMLElement));return n.observedAttributes=N(e),n};return customElements.define("l-map",d),customElements.define("l-control-layers",p),customElements.define("l-base-layers",s),customElements.define("l-overlay-layers",y),customElements.define("l-layer-group",h),customElements.define("l-tile-layer",m),customElements.define("l-marker",b),customElements.define("l-popup",v),customElements.define("l-lat-lng-bounds",g),customElements.define("l-image-overlay",E),customElements.define("l-video-overlay",L),customElements.define("l-geojson",O),customElements.define("l-icon",A),customElements.define("l-circle",J(t.circle,"circle")),customElements.define("l-polyline",J(t.polyline,"polyline")),customElements.define("l-polygon",J(t.polygon,"polygon")),void customElements.define("l-rectangle",J(t.rectangle,"rectangle"))});
|
2
|
-
//# sourceMappingURL=leaflet-html.umd.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"leaflet-html.umd.js","sources":["../src/events.js","../src/l-base-layers.js","../src/l-control-layers.js","../src/l-layer.js","../src/l-layer-group.js","../src/l-map.js","../src/l-marker.js","../src/l-overlay-layers.js","../src/l-popup.js","../src/l-tile-layer.js","../src/l-lat-lng-bounds.js","../src/l-image-overlay.js","../src/l-video-overlay.js","../src/l-geojson.js","../src/l-icon.js","../src/generator.js","../src/index.js"],"sourcesContent":["export const mapAddTo = \"map:addTo\";\nexport const popupAdd = \"popup:add\";\nexport const layerRemove = \"layer:remove\";\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LBaseLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"base\";\n });\n }\n}\n\nexport default LBaseLayers;\n","// @ts-check\n/** @typedef {import(\"leaflet\").Layer} Layer */\nimport { control } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LControlLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n /** @type {{ [key: string]: Layer }} */\n const base = {};\n /** @type {{ [key: string]: Layer }} */\n const overlay = {};\n const controlLayers = control.layers(base, overlay);\n\n this.addEventListener(mapAddTo, (ev) => {\n const { type, name, layer } = ev.detail;\n if (type === \"overlay\") {\n controlLayers.addOverlay(layer, name);\n } else if (type === \"base\") {\n controlLayers.addBaseLayer(layer, name);\n }\n ev.preventDefault();\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: controlLayers,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LControlLayers;\n","class LLayer extends HTMLElement {\n constructor() {\n super()\n this.layer = null\n }\n}\n\nexport default LLayer\n","// @ts-check\nimport { layerGroup } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LLayerGroup extends LLayer {\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const group = layerGroup();\n this.layer = group;\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: group,\n name,\n },\n });\n this.dispatchEvent(event);\n\n this.addEventListener(mapAddTo, (ev) => {\n ev.stopPropagation();\n group.addLayer(ev.detail.layer);\n });\n\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const leafletId = node.getAttribute(\"leaflet-id\");\n if (leafletId !== null) {\n const layer = group.getLayer(parseInt(leafletId));\n if (typeof layer !== \"undefined\") {\n group.removeLayer(layer);\n }\n }\n }\n });\n });\n });\n observer.observe(this, { childList: true });\n }\n}\n\nexport default LLayerGroup;\n","// @ts-check\nimport * as L from \"leaflet\";\nimport { layerRemove, mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMap extends HTMLElement {\n constructor() {\n super();\n\n this.map = null;\n this.addEventListener(\"map:bounds\", (ev) => {\n const { bounds, method } = ev.detail;\n if (this.map !== null) {\n this.map[method](bounds);\n }\n });\n\n // Observe removed l-tile-layers\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach((mutation) => {\n if (mutation.target instanceof LMap) {\n const el = mutation.target\n mutation.removedNodes.forEach((node) => {\n if (node instanceof LLayer) {\n if ((el.map !== null) && (node.layer !== null)) {\n el.map.removeLayer(node.layer)\n }\n }\n })\n }\n })\n })\n observer.observe(this, { childList: true })\n }\n\n connectedCallback() {\n this.map = L.map(this);\n const center = this.getAttribute(\"center\");\n const zoom = this.getAttribute(\"zoom\");\n if (center !== null && zoom !== null) {\n this.map.setView(JSON.parse(center), parseInt(zoom));\n }\n this.addEventListener(mapAddTo, (ev) => {\n const layer = ev.detail.layer;\n layer.addTo(this.map);\n });\n\n this.addEventListener(layerRemove, (ev) => {\n if (this.map !== null) {\n this.map.removeLayer(ev.detail.layer);\n }\n });\n }\n}\n\nexport default LMap;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\nimport { mapAddTo, popupAdd } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LMarker extends LLayer {\n static observedAttributes = [\"lat-lng\", \"opacity\", \"icon\"];\n\n constructor() {\n super();\n this.layer = null;\n this.addEventListener(\"icon:add\", (ev) => {\n ev.stopPropagation();\n this.layer.setIcon(ev.detail.icon);\n });\n }\n\n connectedCallback() {\n const latLng = JSON.parse(this.getAttribute(\"lat-lng\"));\n const opacity = parseFloat(this.getAttribute(\"opacity\") || \"1.0\");\n this.layer = L.marker(latLng, { opacity });\n if (this.hasAttribute(\"icon\")) {\n const icon = L.icon(JSON.parse(this.getAttribute(\"icon\")));\n this.layer.setIcon(icon);\n }\n\n this.setAttribute(\"leaflet-id\", L.stamp(this.layer));\n\n this.addEventListener(popupAdd, (ev) => {\n const { content } = ev.detail;\n this.layer.bindPopup(content);\n });\n\n const event = new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"lat-lng\") {\n this.layer.setLatLng(JSON.parse(newValue));\n }\n if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n if (name === \"icon\") {\n this.layer.setIcon(L.icon(JSON.parse(newValue)));\n }\n }\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-marker\", LMarker);\n });\n\n it(\"default icon\", () => {\n const el = document.createElement(\"l-marker\");\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = new L.Icon.Default();\n expect(actual).toEqual(expected);\n });\n\n it(\"adds an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute before appendChild\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"foo.png\" }));\n document.body.appendChild(el);\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"foo.png\" });\n expect(actual).toEqual(expected);\n });\n\n it(\"changes an icon\", () => {\n const el = document.createElement(\"l-marker\");\n // Set attribute after appendChild\n document.body.appendChild(el);\n el.setAttribute(\"icon\", JSON.stringify({ iconUrl: \"bar.png\" }));\n let actual = el.layer.getIcon();\n let expected = L.icon({ iconUrl: \"bar.png\" });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LMarker;\n","// @ts-check\nimport { mapAddTo } from \"./events.js\";\n\nclass LOverlayLayers extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n this.addEventListener(mapAddTo, (ev) => {\n ev.detail[\"type\"] = \"overlay\";\n });\n }\n}\n\nexport default LOverlayLayers;\n","// @ts-check\nimport { popupAdd } from \"./events.js\";\n\nclass LPopup extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const content = this.getAttribute(\"content\");\n const event = new CustomEvent(popupAdd, {\n cancelable: true,\n bubbles: true,\n detail: {\n content,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LPopup;\n","// @ts-check\nimport { tileLayer } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LTileLayer extends LLayer {\n constructor() {\n super();\n this.layer = null\n }\n\n connectedCallback() {\n const name = this.getAttribute(\"name\");\n const urlTemplate = this.getAttribute(\"url-template\");\n if (urlTemplate === null) {\n return;\n }\n const options = {};\n const key = \"attribution\";\n if (this.hasAttribute(key)) {\n options[key] = this.getAttribute(key);\n }\n this.layer = tileLayer(urlTemplate, options);\n const event = new CustomEvent(mapAddTo, {\n detail: { name, layer: this.layer },\n bubbles: true,\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LTileLayer;\n","// @ts-check\nclass LLatLngBounds extends HTMLElement {\n static observedAttributes = [\"bounds\"];\n\n constructor() {\n super();\n }\n\n attributeChangedCallback(_name, _oldValue, newValue) {\n const event = new CustomEvent(\"map:bounds\", {\n bubbles: true,\n detail: {\n bounds: JSON.parse(newValue),\n method: this.getAttribute(\"method\") || \"fitBounds\",\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nexport default LLatLngBounds;\n","// @ts-check\nimport { imageOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LImageOverlay extends LLayer {\n static observedAttributes = [\"url\", \"bounds\", \"opacity\"];\n\n constructor() {\n super();\n this.layer = null;\n }\n\n connectedCallback() {\n const url = this.getAttribute(\"url\");\n if (url === null) {\n console.warn(\"attribute 'url' not set\");\n return;\n }\n let bounds = this.getAttribute(\"bounds\");\n if (bounds === null) {\n console.warn(\"attribute 'bounds' not set\");\n return;\n }\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n };\n this.layer = imageOverlay(url, JSON.parse(bounds), options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer,\n },\n }),\n );\n }\n\n attributeChangedCallback(name, _oldValue, newValue) {\n if (this.layer !== null) {\n if (name === \"url\") {\n this.layer.setUrl(newValue);\n } else if (name === \"bounds\") {\n this.layer.setBounds(JSON.parse(newValue));\n } else if (name === \"opacity\") {\n this.layer.setOpacity(parseFloat(newValue));\n }\n }\n }\n}\n\nexport default LImageOverlay;\n","// @ts-check\nimport { videoOverlay } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\nimport LLayer from \"./l-layer.js\";\n\nclass LVideoOverlay extends LLayer {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const url = JSON.parse(this.getAttribute(\"url\"));\n const bounds = JSON.parse(this.getAttribute(\"bounds\"));\n const options = {\n opacity: parseFloat(this.getAttribute(\"opacity\") || \"1.0\"),\n alt: this.getAttribute(\"alt\") || \"\",\n autoplay: true,\n muted: true,\n playsInline: true,\n };\n const layer = videoOverlay(url, bounds, options);\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n cancelable: true,\n bubbles: true,\n detail: {\n layer,\n },\n }),\n );\n }\n}\n\nexport default LVideoOverlay;\n","// @ts-check\nimport { geoJSON } from \"leaflet\";\nimport { mapAddTo } from \"./events.js\";\n\nclass LGeoJSON extends HTMLElement {\n constructor() {\n super();\n }\n\n connectedCallback() {\n const value = this.getAttribute(\"geojson\");\n if (value !== null) {\n const layer = geoJSON(JSON.parse(value));\n this.dispatchEvent(\n new CustomEvent(mapAddTo, {\n bubbles: true,\n cancelable: true,\n detail: {\n layer,\n },\n }),\n );\n }\n }\n}\n\nexport default LGeoJSON;\n","// @vitest-environment happy-dom\nimport * as L from \"leaflet\";\n\nconst camelCase = (kebab) => kebab.replace(/-./g, (x) => x[1].toUpperCase());\n\nclass LIcon extends HTMLElement {\n constructor() {\n super();\n this.icon = null;\n }\n\n connectedCallback() {\n const options = {};\n\n // Strings\n let keys = [\n \"icon-url\",\n \"icon-retina-url\",\n \"shadow-url\",\n \"shadow-retina-url\",\n \"class-name\",\n ];\n keys.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = this.getAttribute(key);\n }\n });\n\n // Points\n let points = [\n \"icon-anchor\",\n \"icon-size\",\n \"shadow-anchor\",\n \"shadow-size\",\n \"tooltip-anchor\",\n \"popup-anchor\",\n ];\n points.forEach((key) => {\n if (this.hasAttribute(key)) {\n options[camelCase(key)] = JSON.parse(this.getAttribute(key));\n }\n });\n\n if (this.hasAttribute(\"cross-origin\")) {\n options.crossOrigin = this.getAttribute(\"cross-origin\") === \"true\";\n }\n this.icon = L.icon(options);\n\n const event = new CustomEvent(\"icon:add\", {\n cancelable: true,\n bubbles: true,\n detail: {\n icon: this.icon,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\nif (import.meta.vitest) {\n const { it, expect, beforeAll } = import.meta.vitest;\n\n beforeAll(() => {\n customElements.define(\"l-icon\", LIcon);\n });\n\n it(\"default\", () => {\n const el = document.createElement(\"l-icon\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"emits icon:add event\", async () => {\n const el = document.createElement(\"l-icon\");\n let promise = new Promise((resolve) => {\n el.addEventListener(\"icon:add\", (ev) => {\n resolve(ev.detail.icon);\n });\n });\n document.body.appendChild(el);\n let actual = await promise;\n let expected = L.icon();\n expect(actual).toEqual(expected);\n });\n\n it(\"options\", () => {\n const el = document.createElement(\"l-icon\");\n el.setAttribute(\"icon-url\", \"url.png\");\n el.setAttribute(\"icon-retina-url\", \"retina.png\");\n el.setAttribute(\"icon-size\", \"[0, 0]\");\n el.setAttribute(\"icon-anchor\", \"[0, 0]\");\n el.setAttribute(\"popup-anchor\", \"[0, 0]\");\n el.setAttribute(\"tooltip-anchor\", \"[0, 0]\");\n el.setAttribute(\"shadow-url\", \"urlShadow.png\");\n el.setAttribute(\"shadow-retina-url\", \"retinaShadow.png\");\n el.setAttribute(\"shadow-size\", \"[0, 0]\");\n el.setAttribute(\"shadow-anchor\", \"[0, 0]\");\n el.setAttribute(\"class-name\", \"foo\");\n el.setAttribute(\"cross-origin\", \"true\");\n document.body.appendChild(el);\n\n let actual = el.icon;\n let expected = L.icon({\n iconUrl: \"url.png\",\n iconRetinaUrl: \"retina.png\",\n iconSize: [0, 0],\n iconAnchor: [0, 0],\n popupAnchor: [0, 0],\n tooltipAnchor: [0, 0],\n shadowUrl: \"urlShadow.png\",\n shadowRetinaUrl: \"retinaShadow.png\",\n shadowSize: [0, 0],\n shadowAnchor: [0, 0],\n className: \"foo\",\n crossOrigin: true,\n });\n expect(actual).toEqual(expected);\n });\n}\n\nexport default LIcon;\n","import { LatLng } from \"leaflet\"\n\nconst ARGS = {\n circle: [[\"lat-lng\", LatLng]],\n polyline: [[\"lat-lngs\", LatLng]], // TODO: LatLng[] array\n polygon: [[\"lat-lng\", LatLng]],\n rectangle: [[\"lat-lng\", LatLng]],\n}\nconst OPTIONS = {\n circle: {\n radius: [Number, null]\n },\n polyline: {\n smoothFactor: [Number, 1.0],\n noClip: [Boolean, false]\n },\n polygon: {},\n path: {\n stroke: [Boolean, true],\n color: [String, \"#3388ff\"],\n weight: [Number, 3],\n opacity: [Number, 1.0],\n lineCap: [String, \"round\"],\n lineJoin: [String, \"round\"],\n },\n layer: {},\n rectangle: {}\n}\n\nconst INHERITS = {\n circle: [\"path\", \"layer\"],\n polyline: [\"path\", \"layer\"],\n polygon: [\"polyline\"],\n rectangle: [\"path\", \"layer\"],\n}\n\n// TODO: Generalise approach\nconst setter = (layer, name, newValue) => {\n switch(name) {\n case \"lat-lngs\":\n layer.setLatLngs(JSON.parse(newValue))\n break;\n case \"weight\":\n layer.setStyle({ weight: parseInt(newValue) })\n break;\n case \"color\":\n layer.setStyle({ color: newValue })\n break;\n }\n}\n\nconst attributes = (methodName) => {\n let args = ARGS[methodName].map(x => x[0])\n let attrs = Object.keys(OPTIONS[methodName])\n INHERITS[methodName].forEach((parent) => {\n attrs.push(...Object.keys(OPTIONS[parent]))\n })\n attrs = attrs.map(camelToKebab)\n attrs.push(...args)\n return attrs\n}\n\nconst camelToKebab = (s) => {\n return s.split('').map((letter, idx) => {\n return letter.toUpperCase() === letter\n ? `${idx !== 0 ? '-' : ''}${letter.toLowerCase()}`\n : letter;\n }).join('');\n}\n\nconst settings = (el, methodName) => {\n // Gather settings\n let result = {} \n let process = (opts) => {\n Object.entries(opts).forEach(([key, value]) => {\n const [type, val] = value\n const attribute = camelToKebab(key)\n if (el.hasAttribute(attribute)) {\n result[key] = parse(el.getAttribute(attribute), type, val)\n }\n })\n }\n\n // Process inheritance chain\n process(OPTIONS[methodName])\n INHERITS[methodName].forEach(parent => {\n process(OPTIONS[parent])\n })\n return result\n}\n\nconst positional = (el, methodName) => {\n return ARGS[methodName].map(([key, type]) => {\n return parse(el.getAttribute(key), type, null)\n })\n}\n\nconst parse = (text, type, defaultValue) => {\n switch (type) {\n case Number:\n return parseFloat(text)\n case Boolean:\n return text.toLowerCase() === \"true\"\n case String:\n return text\n case LatLng:\n return JSON.parse(text)\n default:\n return defaultValue\n }\n}\n\nconst generator = (method, methodName) => {\n console.log(attributes(methodName))\n class cls extends HTMLElement {\n static observedAttributes = attributes(methodName);\n\n constructor() {\n super()\n this.layer = null\n // TODO: event handlers\n }\n\n connectedCallback() {\n const args = positional(this, methodName)\n const options = settings(this, methodName)\n this.layer = method(...args, options)\n const event = new CustomEvent(\"map:addTo\", {\n cancelable: true,\n bubbles: true,\n detail: {\n layer: this.layer\n },\n });\n this.dispatchEvent(event);\n }\n\n attributeChangedCallback(name, _, newValue) {\n if (this.layer !== null) {\n setter(this.layer, name, newValue)\n }\n }\n }\n return cls\n}\n\n\nexport default generator\n","// @ts-check\nimport LBaseLayers from \"./l-base-layers.js\";\nimport LControlLayers from \"./l-control-layers.js\";\nimport LLayerGroup from \"./l-layer-group.js\";\nimport LMap from \"./l-map.js\";\nimport LMarker from \"./l-marker.js\";\nimport LOverlayLayers from \"./l-overlay-layers.js\";\nimport LPopup from \"./l-popup.js\";\nimport LTileLayer from \"./l-tile-layer.js\";\nimport LLatLngBounds from \"./l-lat-lng-bounds.js\";\nimport LImageOverlay from \"./l-image-overlay.js\";\nimport LVideoOverlay from \"./l-video-overlay.js\";\nimport LGeoJSON from \"./l-geojson.js\";\nimport LIcon from \"./l-icon.js\";\nimport generator from \"./generator.js\";\nimport { circle, polyline, polygon, rectangle } from \"leaflet\"\n\n\nconst init = (() => {\n // Custom elements (order of definition is important)\n customElements.define(\"l-map\", LMap);\n customElements.define(\"l-control-layers\", LControlLayers);\n customElements.define(\"l-base-layers\", LBaseLayers);\n customElements.define(\"l-overlay-layers\", LOverlayLayers);\n customElements.define(\"l-layer-group\", LLayerGroup);\n customElements.define(\"l-tile-layer\", LTileLayer);\n customElements.define(\"l-marker\", LMarker);\n customElements.define(\"l-popup\", LPopup);\n customElements.define(\"l-lat-lng-bounds\", LLatLngBounds);\n customElements.define(\"l-image-overlay\", LImageOverlay);\n customElements.define(\"l-video-overlay\", LVideoOverlay);\n customElements.define(\"l-geojson\", LGeoJSON);\n customElements.define(\"l-icon\", LIcon);\n customElements.define(\"l-circle\", generator(circle, \"circle\"))\n customElements.define(\"l-polyline\", generator(polyline, \"polyline\"))\n customElements.define(\"l-polygon\", generator(polygon, \"polygon\"))\n customElements.define(\"l-rectangle\", generator(rectangle, \"rectangle\"))\n})();\n\nexport default init;\n"],"names":["mapAddTo","popupAdd","LBaseLayers","_HTMLElement","call","this","_inheritsLoose","prototype","connectedCallback","addEventListener","ev","detail","_wrapNativeSuper","HTMLElement","LControlLayers","controlLayers","control","layers","_ev$detail","type","name","layer","addOverlay","addBaseLayer","preventDefault","event","CustomEvent","cancelable","bubbles","dispatchEvent","LLayer","_this","LLayerGroup","_LLayer","getAttribute","group","layerGroup","stopPropagation","addLayer","MutationObserver","mutations","forEach","mutation","removedNodes","node","leafletId","getLayer","parseInt","removeLayer","observe","childList","LMap","map","method","bounds","target","el","_this2","L","center","zoom","setView","JSON","parse","addTo","LMarker","setIcon","icon","_proto","latLng","opacity","parseFloat","marker","hasAttribute","setAttribute","stamp","bindPopup","content","attributeChangedCallback","_oldValue","newValue","setLatLng","setOpacity","observedAttributes","LOverlayLayers","LPopup","LTileLayer","urlTemplate","options","key","tileLayer","LLatLngBounds","_name","LImageOverlay","url","alt","imageOverlay","console","warn","setUrl","setBounds","LVideoOverlay","autoplay","muted","playsInline","videoOverlay","LGeoJSON","value","geoJSON","camelCase","kebab","replace","x","toUpperCase","LIcon","crossOrigin","ARGS","circle","LatLng","polyline","polygon","rectangle","OPTIONS","radius","Number","smoothFactor","noClip","Boolean","path","stroke","color","String","weight","lineCap","lineJoin","INHERITS","attributes","methodName","_attrs2","args","attrs","Object","keys","parent","_attrs","push","apply","camelToKebab","s","split","letter","idx","toLowerCase","join","text","defaultValue","generator","log","cls","_ref2","positional","result","process","opts","entries","_ref","val","attribute","settings","concat","_","setLatLngs","setStyle","setter","customElements","define"],"mappings":"guDAAaA,EAAW,YACXC,EAAW,YCElBC,eAAWC,SAAAA,GACf,SAAAD,IAAc,OACZC,EAAAC,KAAAC,OAAOA,IACT,CAMC,OANAC,EAAAJ,EAAAC,GAAAD,EAAAK,UAEDC,kBAAA,WACEH,KAAKI,iBAAiBT,EAAU,SAACU,GAC/BA,EAAGC,OAAa,KAAI,MACtB,EACF,EAACT,CAAA,CATcC,cASdS,EATuBC,cCEpBC,eAAc,SAAAX,GAClB,SAA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