@npm9912/v-map 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -5
- package/dist/cjs/{cesium-provider-BiFFyAl9.js → cesium-provider-CTtu9eTD.js} +6 -5
- package/dist/cjs/{deck-provider-Ctq3Q8a1.js → deck-provider-fNa818HH.js} +9 -9
- package/dist/cjs/events-BMG7RKne.js +11 -0
- package/dist/cjs/{geotiff-source-RaNzzWkC.js → geotiff-source-B9ARUE9z.js} +1 -1
- package/dist/cjs/{index-ISOEpMC3.js → index-9APmzoa2.js} +6 -6
- package/dist/cjs/{index-CbVT-Con.js → index-BJg0ncfC.js} +4 -4
- package/dist/cjs/{index-CJvvX4yx.js → index-C1ubapwF.js} +4 -4
- package/dist/cjs/{index-B8LHqjyg.js → index-ChrKyU6i.js} +4 -4
- package/dist/cjs/{index-JSwBbvGA.js → index-DmGHwivM.js} +1 -0
- package/dist/cjs/{layer-extension-B_olS0rc.js → layer-extension-D3a-1DFI.js} +1 -1
- package/dist/cjs/{leaflet-provider-DOqfs7g5.js → leaflet-provider-7Nw-AdV_.js} +6 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{messages-D7h4m8Tx.js → messages-CFCxeG8p.js} +0 -9
- package/dist/cjs/{openlayers-provider-Dfeg6L4n.js → openlayers-provider-DMxYtFkS.js} +5 -4
- package/dist/cjs/{polygon-layer-B9PrN7vr.js → polygon-layer-Dx1ZWZP0.js} +1 -1
- package/dist/cjs/{scenegraph-layer-DwNoxQdi.js → scenegraph-layer-ctLehP0q.js} +1 -1
- package/dist/cjs/v-map-builder.cjs.entry.js +4 -3
- package/dist/cjs/v-map-error.cjs.entry.js +121 -0
- package/dist/cjs/v-map-layer-geojson_12.cjs.entry.js +11 -10
- package/dist/cjs/{v-map-layer-helper-iAzxAg9I.js → v-map-layer-helper-DnWpjZ_Q.js} +7 -6
- package/dist/cjs/v-map-layer-terrain-geotiff.cjs.entry.js +5 -4
- package/dist/cjs/v-map-layercontrol.cjs.entry.js +1 -1
- package/dist/cjs/v-map.cjs.js +2 -2
- package/dist/cjs/{v-map.v-map-layer-osm.v-map-layergroup-BsXp3BoL.js → v-map.v-map-layer-osm.v-map-layergroup-BJ3_NqAj.js} +16 -15
- package/dist/cjs/v-map_3.cjs.entry.js +5 -4
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/v-map/v-map.css +3 -0
- package/dist/collection/components/v-map-error/v-map-error.css +136 -0
- package/dist/collection/components/v-map-error/v-map-error.js +277 -0
- package/dist/collection/components/v-map-layer-geojson/v-map-layer-geojson.js +1 -1
- package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.js +1 -1
- package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.js +1 -1
- package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.js +1 -1
- package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.js +1 -1
- package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.js +1 -1
- package/dist/collection/components/v-map-layergroup/v-map-layergroup.js +1 -1
- package/dist/collection/components/v-map-style/v-map-style.js +1 -1
- package/dist/components/cesium-provider.js +1 -1
- package/dist/components/deck-provider.js +1 -1
- package/dist/components/events.js +1 -1
- package/dist/components/geotiff-source.js +1 -1
- package/dist/components/leaflet-provider.js +1 -1
- package/dist/components/logger.js +1 -0
- package/dist/components/openlayers-provider.js +1 -1
- package/dist/components/v-map-builder.js +2 -2
- package/dist/components/v-map-error.d.ts +11 -0
- package/dist/components/v-map-error.js +1 -0
- package/dist/components/v-map-layer-geojson2.js +1 -1
- package/dist/components/v-map-layer-geotiff2.js +1 -1
- package/dist/components/v-map-layer-google2.js +1 -1
- package/dist/components/v-map-layer-helper.js +1 -1
- package/dist/components/v-map-layer-osm2.js +1 -1
- package/dist/components/v-map-layer-scatterplot2.js +1 -1
- package/dist/components/v-map-layer-terrain-geotiff.js +1 -1
- package/dist/components/v-map-layer-terrain2.js +1 -1
- package/dist/components/v-map-layer-tile3d2.js +1 -1
- package/dist/components/v-map-layer-wcs2.js +1 -1
- package/dist/components/v-map-layer-wfs2.js +1 -1
- package/dist/components/v-map-layer-wkt2.js +1 -1
- package/dist/components/v-map-layer-wms2.js +1 -1
- package/dist/components/v-map-layer-xyz2.js +1 -1
- package/dist/components/v-map-layergroup2.js +1 -1
- package/dist/components/v-map-style2.js +2 -2
- package/dist/components/v-map2.js +1 -1
- package/dist/esm/{cesium-provider-BJfAup3w.js → cesium-provider-Bh__cBGf.js} +6 -5
- package/dist/esm/{deck-provider-C7U9VDEq.js → deck-provider-DxIpS4lY.js} +9 -9
- package/dist/esm/events-CrV_misM.js +9 -0
- package/dist/esm/{geotiff-source-esnDnC-u.js → geotiff-source-BRjO-Dvr.js} +1 -1
- package/dist/esm/{index-BIEmlzCf.js → index-Bh2gBu9u.js} +5 -5
- package/dist/esm/{index-jzneDarq.js → index-BoNyIrdq.js} +1 -1
- package/dist/esm/{index-jN06TXUp.js → index-C3mnOs0I.js} +4 -4
- package/dist/esm/{index-B1zwA4IC.js → index-C63kfbil.js} +6 -6
- package/dist/esm/{index-DbSdn93t.js → index-DxbztwCv.js} +7 -7
- package/dist/esm/{layer-extension-CZXK5goK.js → layer-extension-C5Y2UES3.js} +1 -1
- package/dist/esm/{leaflet-provider-Q41TB6ku.js → leaflet-provider-k6JSYiYX.js} +6 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{messages-CMKJzsgL.js → messages-QJHuuz0g.js} +1 -9
- package/dist/esm/{openlayers-provider-CMsDsQTQ.js → openlayers-provider-DIquf3Tx.js} +5 -4
- package/dist/esm/{polygon-layer-ByhxGhWC.js → polygon-layer-ZIT5mJy5.js} +1 -1
- package/dist/esm/{scenegraph-layer-09K_B6DT.js → scenegraph-layer-CNIRd2uu.js} +1 -1
- package/dist/esm/v-map-builder.entry.js +3 -2
- package/dist/esm/v-map-error.entry.js +119 -0
- package/dist/esm/v-map-layer-geojson_12.entry.js +10 -9
- package/dist/esm/{v-map-layer-helper-Dys44Cgo.js → v-map-layer-helper-CuHYsU9f.js} +2 -1
- package/dist/esm/v-map-layer-terrain-geotiff.entry.js +5 -4
- package/dist/esm/v-map-layercontrol.entry.js +1 -1
- package/dist/esm/v-map.js +3 -3
- package/dist/esm/{v-map.v-map-layer-osm.v-map-layergroup-B4pFHuSf.js → v-map.v-map-layer-osm.v-map-layergroup-Zwdvm9PG.js} +10 -9
- package/dist/esm/v-map_3.entry.js +5 -4
- package/dist/types/components/v-map-error/v-map-error.d.ts +79 -0
- package/dist/types/components.d.ts +128 -0
- package/dist/v-map/p-05ee633f.entry.js +1 -0
- package/dist/v-map/p-08ad1392.entry.js +1 -0
- package/dist/v-map/p-2-mR3oVa.js +1 -0
- package/dist/v-map/{p-c21c93fe.entry.js → p-3a57b64a.entry.js} +1 -1
- package/dist/v-map/p-58dda864.entry.js +1 -0
- package/dist/v-map/p-915314c0.entry.js +10 -0
- package/dist/v-map/{p-MyTSFnEk.js → p-9Rt23jlQ.js} +1 -1
- package/dist/v-map/p-BSsFEMZP.js +1 -0
- package/dist/v-map/{p-jzneDarq.js → p-BoNyIrdq.js} +2 -2
- package/dist/v-map/p-BpE6L1g0.js +1 -0
- package/dist/v-map/{p-DvHXtWUg.js → p-C0M0-Kvt.js} +1 -1
- package/dist/v-map/p-CbiLpFhO.js +1 -0
- package/dist/v-map/p-Ci70E1EM.js +1 -0
- package/dist/v-map/p-CrV_misM.js +1 -0
- package/dist/v-map/{p-DrOQ9V4h.js → p-DAf4itFZ.js} +1 -1
- package/dist/v-map/p-DVBtCUtQ.js +1 -0
- package/dist/v-map/{p-CZqY0yW4.js → p-DuJ_mTaq.js} +1 -1
- package/dist/v-map/p-G6iftXUC.js +1 -0
- package/dist/v-map/{p-CMKJzsgL.js → p-QJHuuz0g.js} +1 -1
- package/dist/v-map/{p-aa410e64.entry.js → p-e21ea0ce.entry.js} +2 -2
- package/dist/v-map/{p-DmICdG34.js → p-rCyRSFJb.js} +2 -2
- package/dist/v-map/{p-CafTHT9i.js → p-vhbi5XXi.js} +1 -1
- package/dist/v-map/{p-Dckgonw8.js → p-yXLNXXx-.js} +1 -1
- package/dist/v-map/v-map.esm.js +1 -1
- package/package.json +1 -1
- package/dist/v-map/p--vVleK-M.js +0 -1
- package/dist/v-map/p-09d10db0.entry.js +0 -1
- package/dist/v-map/p-5eba6058.entry.js +0 -10
- package/dist/v-map/p-6b102336.entry.js +0 -1
- package/dist/v-map/p-BdijL4Av.js +0 -1
- package/dist/v-map/p-BeFu0ap4.js +0 -1
- package/dist/v-map/p-BxFJezdK.js +0 -1
- package/dist/v-map/p-DCTHyf58.js +0 -1
- package/dist/v-map/p-WaMDUuAz.js +0 -1
- package/dist/v-map/p-uiIP-taz.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{S as SimpleMeshLayer}from"./p-9Rt23jlQ.js";export{S as ScenegraphLayer}from"./p-DAf4itFZ.js";import"./p-B-bAcABs.js";import"./p-DhQAXuA7.js";import"./p-DR9McdNX.js";import"./p-E-ZsRS8r.js";import"./p-QJHuuz0g.js";import"./p-yXLNXXx-.js";import"@loaders.gl/core";import"@loaders.gl/images";import"@loaders.gl/loader-utils";import"@loaders.gl/terrain";import"@loaders.gl/schema";import"@loaders.gl/gltf";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},s=(t,e)=>e in t,i=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="undefined"!=typeof window?window:{},a={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},f=t=>Promise.resolve(t),d=(()=>{try{return!!u.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!d&&(()=>!!u.document&&Object.getOwnPropertyDescriptor(u.document.adoptedStyleSheets,"length").writable)(),h=!1,m=[],v=[],y=(t,e)=>n=>{t.push(n),h||(h=!0,e&&4&a.u?w($):a.raf($))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},$=()=>{b(m),b(v),(h=m.length>0)&&a.raf($)},w=t=>f().then(t),g=y(v,!0);function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(p?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function S(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var O,k=new WeakMap,E=t=>"sc-"+t.h,M=t=>"object"==(t=typeof t)||"function"===t,C=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!M(o))&&(o+=""),s&&i?r[r.length-1].m+=o:r.push(s?x(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=x(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},x=(t,e)=>({u:0,S:t,m:null!=e?e:null,O:null,$:null,v:null,j:null}),A={},L=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,N=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},P=(t,e,n)=>{const o=N(t);return{emit:t=>R(o,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},R=(t,e,n)=>{const o=a.ce(e,n);return t.dispatchEvent(o),o},D=(t,e,n,l,i,r)=>{if(n===l)return;let c=s(t,e),f=e.toLowerCase();if("class"===e){const e=t.classList,o=H(n);let s=H(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("key"===e);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=M(l);if((c||o&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&r||i)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):s(u,f)?f.slice(2):f[2]+e.slice(3),n||l){const o=e.endsWith(U);e=e.replace(W,""),n&&a.rel(t,e,n,o),l&&a.ael(t,e,l,o)}},T=/\s/,H=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(T):[]),U="Capture",W=RegExp(U+"$"),z=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.v||{},s=e.v||{};for(const t of F(Object.keys(l)))t in s||D(o,t,l[t],void 0,n,e.u);for(const t of F(Object.keys(s)))D(o,t,l[t],s[t],n,e.u)};function F(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,q=!1,G=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.m)l=o.O=u.document.createTextNode(o.m);else{if(!u.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=u.document.createElement(o.S),z(null,o,q),o.$){const e="template"===o.S?l.content:l;for(i=0;i<o.$.length;++i)s=G(t,o,i),s&&e.appendChild(s)}}return l["s-hn"]=O,l},Y=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===O&&(r=r.shadowRoot),"template"===n.S&&(r=r.content);l<=s;++l)o[l]&&(i=G(null,n,l),i&&(o[l].O=i,I(r,i,e)))},Z=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;t&&t.remove()}}},_=(t,e,n=!1)=>t.S===e.S&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),B=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,i=e.m;null==i?("slot"!==e.S||V||t.k!==e.k&&(e.O["s-sn"]=e.k||"",(t=>{a.u|=1;const e=t.closest(O.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(I(e,t,null!=n?n:null),t["s-sh"]=void 0)}a.u&=-2})(e.O.parentElement)),z(t,e,q),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],p=e[f],h=o.length-1,m=o[0],v=o[h];const y="template"===n.S?t.content:t;for(;r<=f&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--h];else if(_(d,m,l))B(d,m,l),d=e[++r],m=o[++c];else if(_(p,v,l))B(p,v,l),p=e[--f],v=o[--h];else if(_(d,v,l))B(d,v,l),I(y,d.O,p.O.nextSibling),d=e[++r],v=o[--h];else if(_(p,m,l))B(p,m,l),I(y,p.O,d.O),p=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(i=e[u],i.S!==m.S?s=G(e&&e[c],n,u):(B(i,m,l),e[u]=void 0,s=i.O),m=o[++c]):(s=G(e&&e[c],n,c),m=o[++c]),s&&I(d.O.parentNode,s,d.O)}r>f?Y(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&Z(e,r,f)})(o,l,e,s,n):null!==s?(null!==t.m&&(o.textContent=""),Y(o,null,e,s,0,s.length-1)):!n&&null!==l&&Z(l,0,l.length-1)):t.m!==i&&(o.data=i)},I=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),J=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},K=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);J(t,t.C);const n=()=>Q(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},Q=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.u|=256,t.A&&(t.A.map((([t,e])=>st(o,t,e,n))),t.A=void 0),t.L.length&&t.L.forEach((t=>t(n))),l=st(o,"componentWillLoad",void 0,n)):l=st(o,"componentWillUpdate",void 0,n),l=X(l,(()=>st(o,"componentWillRender",void 0,n))),X(l,(()=>et(t,o,e)))},X=(t,e)=>tt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),tt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,et=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const s=E(e),i=c.get(s);if(!u.document)return s;if(t=11===t.nodeType?t:u.document,i)if("string"==typeof i){let l,r=k.get(t=t.head||t);if(r||k.set(t,r=new Set),!r.has(s)){l=u.document.createElement("style"),l.textContent=i;const c=null!=(n=a.N)?n:S(u.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(d){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(i),p?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=i+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(i.constructor===n.CSSStyleSheet)o=i;else{o=new n.CSSStyleSheet;for(let t=0;t<i.cssRules.length;t++)o.insertRule(i.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);nt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ot(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},nt=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.P||x(null,null),i=(t=>t&&t.S===A)(e)?e:C(null,null,e);if(O=o.tagName,l.R&&(i.v=i.v||{},l.R.forEach((([t,e])=>{i.v[e]=o[t]}))),n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.S=null,i.u|=4,t.P=i,i.O=s.O=o.shadowRoot||o,V=!(!(1&l.u)||128&l.u),B(s,i,n)})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},ot=t=>{const e=t.$hostElement$,n=t.i,o=t.C;st(n,"componentDidRender",void 0,e),64&t.u?st(n,"componentDidUpdate",void 0,e):(t.u|=64,it(e),st(n,"componentDidLoad",void 0,e),t.D(e),o||lt()),t.T(e),t.M&&(t.M(),t.M=void 0),512&t.u&&w((()=>K(t,!1))),t.u&=-517},lt=()=>{w((()=>R(u,"appload",{detail:{namespace:"v-map"}})))},st=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},it=t=>t.classList.add("hydrated"),rt=(t,e,n,l)=>{const s=o(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,a=s.i;if(n=L(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(s.l.set(e,n),l.H){const t=l.H[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(a?a[o](n,c,e):s.L.push((()=>{s.i[o](n,c,e)})))}catch(t){i(t,r)}}))}if(2&u){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||K(s,!1)}}},ct=(e,n,l)=>{var s,i;const r=e.prototype;{e.watchers&&!n.H&&(n.H=e.watchers),e.deserializers&&!n.U&&(n.U=e.deserializers),e.serializers&&!n.W&&(n.W=e.serializers);const c=Object.entries(null!=(s=n.t)?s:{});if(c.map((([e,[s]])=>{if(31&s||2&l&&32&s){const{get:i,set:c}=t(r,e)||{};i&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!i)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const i=o(this);if(i){if(c)return void 0===(32&s?this[e]:i.$hostElement$[e])&&i.l.get(e)&&(t=i.l.get(e)),c.call(this,L(t,s)),void rt(this,e,t=32&s?this[e]:i.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return rt(this,e,t,n),void(1&l&&!i.i&&i.L.push((()=>{4096&n.t[e][0]&&i.i[e]!==i.l.get(e)&&(i.i[e]=t)})));const o=()=>{const o=i.i[e];!i.l.get(e)&&o&&i.l.set(e,o),i.i[e]=L(t,s),rt(this,e,i.i[e],n)};i.i?o():i.L.push((()=>{o()}))}}}})}else 1&l&&64&s&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.F)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[e](...t)}))}})})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,s){a.jmp((()=>{var i;const u=t.get(e),a=o(this);if(this.hasOwnProperty(u)&&(s=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==a?void 0:a.u;if(a&&t&&!(8&t)&&s!==l){const o=a.i,r=null==(i=n.H)?void 0:i[e];null==r||r.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const f=c.find((([t])=>t===u));f&&4&f[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(r,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=n.H)?i:{}),...c.filter((([t,e])=>31&e[0])).map((([e,o])=>{var l;const s=o[1]||e;return t.set(s,e),512&o[0]&&(null==(l=n.R)||l.push([e,s])),s}))]))}}return e},ut=(t,e)=>{st(t,"connectedCallback",void 0,e)},at=(t,e)=>{st(t,"disconnectedCallback",void 0,e||t)},ft=(t,e={})=>{var n;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],s=e.exclude||[],f=u.customElements,p=u.document.head,h=p.querySelector("meta[charset]"),m=u.document.createElement("style"),v=[];let y,b=!0;if(Object.assign(a,e),a.p=new URL(e.resourcesUrl||"./",u.document.baseURI).href,t.map((t=>{t[1].map((e=>{var n,u,p;const h={u:e[0],h:e[1],t:e[2],V:e[3]};h.t=e[2],h.V=e[3],h.R=[],h.H=null!=(n=e[4])?n:{},h.W=null!=(u=e[5])?u:{},h.U=null!=(p=e[6])?p:{};const m=h.h,$=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,q:new Map};n.F=new Promise((t=>n.T=t)),n.G=new Promise((t=>n.D=t)),t["s-p"]=[],t["s-rc"]=[],n.L=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,h),1&h.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${h.h}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(t,h)}connectedCallback(){const t=o(this);t&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,dt(this,t,h.V)),y&&(clearTimeout(y),y=null),b?v.push(this):a.jmp((()=>(t=>{if(!(1&a.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)dt(t,e,n.V),(null==e?void 0:e.i)?ut(e.i,t):(null==e?void 0:e.G)&&e.G.then((()=>ut(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u)){if(e.u|=32,n.Y){const l=((t,e)=>{const n=t.h.replace(/-/g,"_"),o=t.Y;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.h}#${e.Z}" was not found`);o.isProxied||(n.
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},s=(t,e)=>e in t,i=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="undefined"!=typeof window?window:{},a={u:0,p:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},f=t=>Promise.resolve(t),d=(()=>{try{return!!u.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!d&&(()=>!!u.document&&Object.getOwnPropertyDescriptor(u.document.adoptedStyleSheets,"length").writable)(),h=!1,m=[],v=[],y=(t,e)=>n=>{t.push(n),h||(h=!0,e&&4&a.u?w($):a.raf($))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},$=()=>{b(m),b(v),(h=m.length>0)&&a.raf($)},w=t=>f().then(t),g=y(v,!0);function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(p?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function S(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var O,k=new WeakMap,E=t=>"sc-"+t.h,M=t=>"object"==(t=typeof t)||"function"===t,C=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!M(o))&&(o+=""),s&&i?r[r.length-1].m+=o:r.push(s?x(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=x(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},x=(t,e)=>({u:0,S:t,m:null!=e?e:null,O:null,$:null,v:null,j:null}),A={},L=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,N=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},P=(t,e,n)=>{const o=N(t);return{emit:t=>R(o,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},R=(t,e,n)=>{const o=a.ce(e,n);return t.dispatchEvent(o),o},D=(t,e,n,l,i,r)=>{if(n===l)return;let c=s(t,e),f=e.toLowerCase();if("class"===e){const e=t.classList,o=T(n);let s=T(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("key"===e);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=M(l);if((c||o&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&r||i)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):s(u,f)?f.slice(2):f[2]+e.slice(3),n||l){const o=e.endsWith(U);e=e.replace(W,""),n&&a.rel(t,e,n,o),l&&a.ael(t,e,l,o)}},H=/\s/,T=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(H):[]),U="Capture",W=RegExp(U+"$"),z=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.v||{},s=e.v||{};for(const t of F(Object.keys(l)))t in s||D(o,t,l[t],void 0,n,e.u);for(const t of F(Object.keys(s)))D(o,t,l[t],s[t],n,e.u)};function F(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,q=!1,G=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.m)l=o.O=u.document.createTextNode(o.m);else{if(!u.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=u.document.createElement(o.S),z(null,o,q),o.$){const e="template"===o.S?l.content:l;for(i=0;i<o.$.length;++i)s=G(t,o,i),s&&e.appendChild(s)}}return l["s-hn"]=O,l},Y=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===O&&(r=r.shadowRoot),"template"===n.S&&(r=r.content);l<=s;++l)o[l]&&(i=G(null,n,l),i&&(o[l].O=i,I(r,i,e)))},Z=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;t&&t.remove()}}},_=(t,e,n=!1)=>t.S===e.S&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),B=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,i=e.m;null==i?("slot"!==e.S||V||t.k!==e.k&&(e.O["s-sn"]=e.k||"",(t=>{a.u|=1;const e=t.closest(O.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(I(e,t,null!=n?n:null),t["s-sh"]=void 0)}a.u&=-2})(e.O.parentElement)),z(t,e,q),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],p=e[f],h=o.length-1,m=o[0],v=o[h];const y="template"===n.S?t.content:t;for(;r<=f&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--h];else if(_(d,m,l))B(d,m,l),d=e[++r],m=o[++c];else if(_(p,v,l))B(p,v,l),p=e[--f],v=o[--h];else if(_(d,v,l))B(d,v,l),I(y,d.O,p.O.nextSibling),d=e[++r],v=o[--h];else if(_(p,m,l))B(p,m,l),I(y,p.O,d.O),p=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(i=e[u],i.S!==m.S?s=G(e&&e[c],n,u):(B(i,m,l),e[u]=void 0,s=i.O),m=o[++c]):(s=G(e&&e[c],n,c),m=o[++c]),s&&I(d.O.parentNode,s,d.O)}r>f?Y(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&Z(e,r,f)})(o,l,e,s,n):null!==s?(null!==t.m&&(o.textContent=""),Y(o,null,e,s,0,s.length-1)):!n&&null!==l&&Z(l,0,l.length-1)):t.m!==i&&(o.data=i)},I=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),J=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},K=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);J(t,t.C);const n=()=>Q(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},Q=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.u|=256,t.A&&(t.A.map((([t,e])=>st(o,t,e,n))),t.A=void 0),t.L.length&&t.L.forEach((t=>t(n))),l=st(o,"componentWillLoad",void 0,n)):l=st(o,"componentWillUpdate",void 0,n),l=X(l,(()=>st(o,"componentWillRender",void 0,n))),X(l,(()=>et(t,o,e)))},X=(t,e)=>tt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),tt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,et=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const s=E(e),i=c.get(s);if(!u.document)return s;if(t=11===t.nodeType?t:u.document,i)if("string"==typeof i){let l,r=k.get(t=t.head||t);if(r||k.set(t,r=new Set),!r.has(s)){l=u.document.createElement("style"),l.textContent=i;const c=null!=(n=a.N)?n:S(u.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(d){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(i),p?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=i+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(i.constructor===n.CSSStyleSheet)o=i;else{o=new n.CSSStyleSheet;for(let t=0;t<i.cssRules.length;t++)o.insertRule(i.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);nt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ot(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},nt=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.P||x(null,null),i=(t=>t&&t.S===A)(e)?e:C(null,null,e);if(O=o.tagName,l.R&&(i.v=i.v||{},l.R.forEach((([t,e])=>{i.v[e]=o[t]}))),n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.S=null,i.u|=4,t.P=i,i.O=s.O=o.shadowRoot||o,V=!(!(1&l.u)||128&l.u),B(s,i,n)})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},ot=t=>{const e=t.$hostElement$,n=t.i,o=t.C;st(n,"componentDidRender",void 0,e),64&t.u?st(n,"componentDidUpdate",void 0,e):(t.u|=64,it(e),st(n,"componentDidLoad",void 0,e),t.D(e),o||lt()),t.H(e),t.M&&(t.M(),t.M=void 0),512&t.u&&w((()=>K(t,!1))),t.u&=-517},lt=()=>{w((()=>R(u,"appload",{detail:{namespace:"v-map"}})))},st=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},it=t=>t.classList.add("hydrated"),rt=(t,e,n,l)=>{const s=o(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,a=s.i;if(n=L(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(s.l.set(e,n),l.T){const t=l.T[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(a?a[o](n,c,e):s.L.push((()=>{s.i[o](n,c,e)})))}catch(t){i(t,r)}}))}if(2&u){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||K(s,!1)}}},ct=(e,n,l)=>{var s,i;const r=e.prototype;{e.watchers&&!n.T&&(n.T=e.watchers),e.deserializers&&!n.U&&(n.U=e.deserializers),e.serializers&&!n.W&&(n.W=e.serializers);const c=Object.entries(null!=(s=n.t)?s:{});if(c.map((([e,[s]])=>{if(31&s||2&l&&32&s){const{get:i,set:c}=t(r,e)||{};i&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!i)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const i=o(this);if(i){if(c)return void 0===(32&s?this[e]:i.$hostElement$[e])&&i.l.get(e)&&(t=i.l.get(e)),c.call(this,L(t,s)),void rt(this,e,t=32&s?this[e]:i.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return rt(this,e,t,n),void(1&l&&!i.i&&i.L.push((()=>{4096&n.t[e][0]&&i.i[e]!==i.l.get(e)&&(i.i[e]=t)})));const o=()=>{const o=i.i[e];!i.l.get(e)&&o&&i.l.set(e,o),i.i[e]=L(t,s),rt(this,e,i.i[e],n)};i.i?o():i.L.push((()=>{o()}))}}}})}else 1&l&&64&s&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.F)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[e](...t)}))}})})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,s){a.jmp((()=>{var i;const u=t.get(e),a=o(this);if(this.hasOwnProperty(u)&&(s=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==a?void 0:a.u;if(a&&t&&!(8&t)&&s!==l){const o=a.i,r=null==(i=n.T)?void 0:i[e];null==r||r.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const f=c.find((([t])=>t===u));f&&4&f[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(r,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=n.T)?i:{}),...c.filter((([t,e])=>31&e[0])).map((([e,o])=>{var l;const s=o[1]||e;return t.set(s,e),512&o[0]&&(null==(l=n.R)||l.push([e,s])),s}))]))}}return e},ut=(t,e)=>{st(t,"connectedCallback",void 0,e)},at=(t,e)=>{st(t,"disconnectedCallback",void 0,e||t)},ft=(t,e={})=>{var n;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],s=e.exclude||[],f=u.customElements,p=u.document.head,h=p.querySelector("meta[charset]"),m=u.document.createElement("style"),v=[];let y,b=!0;if(Object.assign(a,e),a.p=new URL(e.resourcesUrl||"./",u.document.baseURI).href,t.map((t=>{t[1].map((e=>{var n,u,p;const h={u:e[0],h:e[1],t:e[2],V:e[3]};h.t=e[2],h.V=e[3],h.R=[],h.T=null!=(n=e[4])?n:{},h.W=null!=(u=e[5])?u:{},h.U=null!=(p=e[6])?p:{};const m=h.h,$=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,q:new Map};n.F=new Promise((t=>n.H=t)),n.G=new Promise((t=>n.D=t)),t["s-p"]=[],t["s-rc"]=[],n.L=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,h),1&h.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${h.h}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(t,h)}connectedCallback(){const t=o(this);t&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,dt(this,t,h.V)),y&&(clearTimeout(y),y=null),b?v.push(this):a.jmp((()=>(t=>{if(!(1&a.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)dt(t,e,n.V),(null==e?void 0:e.i)?ut(e.i,t):(null==e?void 0:e.G)&&e.G.then((()=>ut(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u)){if(e.u|=32,n.Y){const l=((t,e)=>{const n=t.h.replace(/-/g,"_"),o=t.Y;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.h}#${e.Z}" was not found`);o.isProxied||(n.T=o.watchers,n.W=o.serializers,n.U=o.deserializers,ct(o,n,2),o.isProxied=!0);const s=()=>{};e.u|=8;try{new o(e)}catch(e){i(e,t)}e.u&=-9,e.u|=128,s(),ut(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=E(n);if(!c.has(e)){const o=()=>{};((t,e,n)=>{let o=c.get(t);d&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,c.set(t,o)})(e,t,!!(1&n.u)),o()}}}const l=e.C,s=()=>K(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){i(n,t),e.M&&(e.M(),e.M=void 0),e.D&&e.D(t)}})(t,e,n)}l()}})(this))))}disconnectedCallback(){a.jmp((()=>(async t=>{if(!(1&a.u)){const e=o(t);(null==e?void 0:e._)&&(e._.map((t=>t())),e._=void 0),(null==e?void 0:e.i)?at(e.i,t):(null==e?void 0:e.G)&&e.G.then((()=>at(e.i,t)))}k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this))),a.raf((()=>{var t;const e=o(this);if(!e)return;const n=v.findIndex((t=>t===this));n>-1&&v.splice(n,1),(null==(t=null==e?void 0:e.P)?void 0:t.O)instanceof Node&&!e.P.O.isConnected&&delete e.P.O}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.G}};h.Y=t[0],s.includes(m)||f.get(m)||(l.push(m),f.define(m,ct($,h,1)))}))})),l.length>0&&(m.textContent+=l.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(n=a.N)?n:S(u.document);null!=t&&m.setAttribute("nonce",t),p.insertBefore(m,h?h.nextSibling:p.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):a.jmp((()=>y=setTimeout(lt,30)))},dt=(t,e,n)=>{n&&u.document&&n.map((([n,o,l])=>{const s=ht(u.document,t,n),i=pt(e,l),r=mt(n);a.ael(s,o,i,r),(e._=e._||[]).push((()=>a.rel(s,o,i,r)))}))},pt=(t,e)=>n=>{var o;try{256&t.u?null==(o=t.i)||o[e](n):(t.A=t.A||[]).push([e,n])}catch(e){i(e,t.$hostElement$)}},ht=(t,e,n)=>4&n?t:e,mt=t=>({passive:!!(1&t),capture:!!(2&t)}),vt=t=>a.N=t;export{A as H,ft as b,P as c,N as g,C as h,f as p,l as r,vt as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as t,q as s,s as o,t as r,v as e,w as n,x as h,V as u,y as m,z as g,A as f,D as P,E as M,F as v,H as w,J as b,K as x,N as y,O as S,Q as z,R as Z,M as R,G as O,u as _,X,Y as A,Z as D,_ as V,$ as E,a0 as F,a1 as I,a2 as T,a3 as B,a4 as N,a5 as $,a6 as q,a7 as Y,a8 as G,a9 as Q,aa as J,ab as H,ac as W,ad as K,ae as tt}from"./p-9Rt23jlQ.js";export{aj as AmbientLight,ao as Attribute,ap as AttributeManager,C as CompositeLayer,am as Deck,aq as DeckRenderer,L as Layer,an as LayerManager,ai as LightingEffect,au as MapController,at as MapView,ah as OPERATION,av as TRANSITION_EVENTS,ay as Tesselator,U as UNIT,af as VERSION,aH as Widget,aI as _Component,aJ as _ComponentState,ak as _LayersPass,al as _PickLayersPass,aF as _applyStyles,aE as _compareProps,aB as _count,d as _deepEqual,az as _fillArray,aA as _flatten,aC as _memoize,aD as _mergeShaders,aG as _removeStyles,aw as assert,c as color,l as createIterable,ax as fp64LowPart,ag as getShaderAssembler,i as gouraudMaterial,j as log,k as phongMaterial,a as picking,ar as project,p as project32,as as shadow}from"./p-9Rt23jlQ.js";export{L as LayerExtension}from"./p-DuJ_mTaq.js";import"./p-B-bAcABs.js";import"./p-DhQAXuA7.js";import"./p-DR9McdNX.js";import"./p-E-ZsRS8r.js";import"./p-QJHuuz0g.js";import"./p-yXLNXXx-.js";import"@loaders.gl/core";import"@loaders.gl/images";import"@loaders.gl/loader-utils";import"@loaders.gl/terrain";import"@loaders.gl/schema";const st=1e-6;class ot{constructor({phi:t=0,theta:s=0,radius:o=1,bearing:i,pitch:r,altitude:e,radiusScale:n=6371e3}={}){this.phi=t,this.theta=s,this.radius=o||e||1,this.radiusScale=n||1,void 0!==i&&(this.bearing=i),void 0!==r&&(this.pitch=r),this.check()}toString(){return this.formatString(t)}formatString({printTypes:t=!1}){const o=s;return`${t?"Spherical":""}[rho:${o(this.radius)},theta:${o(this.theta)},phi:${o(this.phi)}]`}equals(t){return o(this.radius,t.radius)&&o(this.theta,t.theta)&&o(this.phi,t.phi)}exactEquals(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}get bearing(){return 180-r(this.phi)}set bearing(t){this.phi=Math.PI-e(t)}get pitch(){return r(this.theta)}set pitch(t){this.theta=e(t)}get longitude(){return r(this.phi)}get latitude(){return r(this.theta)}get lng(){return r(this.phi)}get lat(){return r(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(t,s,o){return this.radius=t,this.phi=s,this.theta=o,this.check()}clone(){return(new ot).copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}fromLngLatZ([t,s,o]){return this.radius=1+o/this.radiusScale,this.phi=e(s),this.theta=e(t),this.check()}fromVector3(t){return this.radius=n(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(h(t[2]/this.radius,-1,1))),this.check()}toVector3(){return new u(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}makeSafe(){return this.phi=Math.max(st,Math.min(Math.PI-st,this.phi)),this}check(){if(!(Number.isFinite(this.phi)&&Number.isFinite(this.theta)&&this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}const it=["longitude","latitude","zoom"],rt={curve:1.414,speed:1.2};function et(t,s,o){const i=(o=Object.assign({},rt,o)).curve,r=t.zoom,e=[t.longitude,t.latitude],n=x(r),a=[s.longitude,s.latitude],h=x(s.zoom-r),c=M(e),u=M(a),l=v([],u,c),p=Math.max(t.width,t.height),d=p/h,m=b(l)*n,g=Math.max(m,.01),f=i*i,P=(d*d-p*p+f*f*g*g)/(2*p*f*g),w=(d*d-p*p-f*f*g*g)/(2*d*f*g),y=Math.log(Math.sqrt(P*P+1)-P),S=Math.log(Math.sqrt(w*w+1)-w);return{startZoom:r,startCenterXY:c,uDelta:l,w0:p,u1:m,S:(S-y)/i,rho:i,rho2:f,r0:y,r1:S}}const nt=[255,255,255],ht=1,ct=[1,0,0],ut=[0,0,1];let lt=0;class pt{constructor(t={}){this.type="point";const{color:s=nt}=t,{intensity:o=ht}=t,{position:i=ut}=t;this.id=t.id||"point-"+lt++,this.color=s,this.intensity=o,this.type="point",this.position=i,this.attenuation=function(t){return t.attenuation?t.attenuation:ct}(t),this.projectedLight={...this}}getProjectedLight({layer:t}){const{projectedLight:s}=this,o=t.context.viewport,{coordinateSystem:i,coordinateOrigin:r}=t.props,e=y(this.position,{viewport:o,coordinateSystem:i,coordinateOrigin:r,fromCoordinateSystem:o.isGeospatial?S.LNGLAT:S.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return s.color=this.color,s.intensity=this.intensity,s.position=e,s}}class dt extends pt{getProjectedLight({layer:t}){const{projectedLight:s}=this,o=t.context.viewport,{coordinateSystem:i,coordinateOrigin:r,modelMatrix:e}=t.props,{cameraPosition:n}=z({viewport:o,modelMatrix:e,coordinateSystem:i,coordinateOrigin:r});return s.color=this.color,s.intensity=this.intensity,s.position=n,s}}const mt=Math.PI/180,gt=23.4397*mt;function ft(t,s,o){const{azimuth:i,altitude:r}=function(t,s,o){const i=mt*-o,r=mt*s,e=function(t){return function(t){return("number"==typeof t?t:t.getTime())/864e5-.5+2440588}(t)-2451545}(t),n=function(t){const s=function(t){const s=t;return s+mt*(1.9148*Math.sin(s)+.02*Math.sin(2*s)+3e-4*Math.sin(3*s))+102.9372*mt+Math.PI}(mt*(357.5291+.98560028*t));return{declination:Mt(s,0),rightAscension:Pt(s,0)}}(e),a=function(t,s){return mt*(280.147+360.9856235*t)-s}(e,i)-n.rightAscension;return{azimuth:vt(a,r,n.declination),altitude:wt(a,r,n.declination)}}(t,s,o);return[Math.sin(i)*Math.cos(r),Math.cos(i)*Math.cos(r),-Math.sin(r)]}function Pt(t,s){const o=t;return Math.atan2(Math.sin(o)*Math.cos(gt)-Math.tan(s)*Math.sin(gt),Math.cos(o))}function Mt(t,s){const o=t;return Math.asin(Math.sin(s)*Math.cos(gt)+Math.cos(s)*Math.sin(gt)*Math.sin(o))}function vt(t,s,o){const i=t,r=s,e=o;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(e)*Math.cos(r))}function wt(t,s,o){const i=t,r=s,e=o;return Math.asin(Math.sin(r)*Math.sin(e)+Math.cos(r)*Math.cos(e)*Math.cos(i))}class bt extends Z{constructor(t){super(t),this.timestamp=t.timestamp}getProjectedLight({layer:t}){const{viewport:s}=t.context;if(s.resolution&&s.resolution>0){const[t,s,o]=ft(this.timestamp,0,0);this.direction=[t,-o,s]}else{const{latitude:t,longitude:o}=s;this.direction=ft(this.timestamp,t,o)}return this}}const xt=[-1,-1,1,-1,-1,1,1,1];class yt extends R{constructor(t,s){const o=xt.map((t=>-1===t?0:t));s.source&&(s={...s,source:`struct VertexInputs {\n @location(0) clipSpacePosition: vec2<f32>,\n @location(1) texCoord: vec2<f32>,\n @location(2) coordinate: vec2<f32> \n}\n\nstruct FragmentInputs {\n @builtin(position) Position : vec4<f32>,\n @location(0) position : vec2<f32>,\n @location(1) coordinate : vec2<f32>,\n @location(2) uv : vec2<f32>\n};\n\n@vertex\nfn vertexMain(inputs: VertexInputs) -> FragmentInputs {\n var outputs: FragmentInputs;\n outputs.Position = vec4(inputs.clipSpacePosition, 0., 1.);\n outputs.position = inputs.clipSpacePosition;\n outputs.coordinate = inputs.coordinate;\n outputs.uv = inputs.texCoord;\n return outputs;\n}\n\n${s.source}`}),super(t,{id:s.id||_("clip-space"),...s,vs:"#version 300 es\nin vec2 clipSpacePositions;\nin vec2 texCoords;\nin vec2 coordinates;\n\nout vec2 position;\nout vec2 coordinate;\nout vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(clipSpacePositions, 0., 1.);\n position = clipSpacePositions;\n coordinate = coordinates;\n uv = texCoords;\n}\n",vertexCount:4,geometry:new O({topology:"triangle-strip",vertexCount:4,attributes:{clipSpacePositions:{size:2,value:new Float32Array(xt)},texCoords:{size:2,value:new Float32Array(o)},coordinates:{size:2,value:new Float32Array(o)}}})})}}const St={name:"screen",fs:"uniform screenUniforms {\n vec2 texSize;\n} screen;\n",uniformTypes:{texSize:"vec2<f32>"}};class zt extends X{constructor(t,s){super(t,s);const{module:o,fs:i,id:r}=s;this.model=new yt(t,{id:r,fs:i,modules:[o,St],parameters:{depthWriteEnabled:!1,depthCompare:"always",depthBias:0,blend:!0,blendColorSrcFactor:"one",blendColorDstFactor:"one-minus-src-alpha",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one-minus-src-alpha",blendColorOperation:"add",blendAlphaOperation:"add"}})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,s){const{clearCanvas:o,inputBuffer:i,outputBuffer:r}=s,e=[i.width,i.height];this.model.shaderInputs.setProps({screen:{texSrc:i.colorAttachments[0],texSize:e},...s.moduleProps});const n=this.device.beginRenderPass({framebuffer:r,parameters:{viewport:[0,0,...e]},clearColor:!!o&&[0,0,0,0],clearDepth:1,clearStencil:!1});this.model.draw(n),n.end()}}class Zt{constructor(t,s){this.id=`${t.name}-pass`,this.props=s,A(t),this.module=t}setup({device:t}){this.passes=function(t,s,o){return s.passes.map(((i,r)=>{const e=function(t,s){return s.filter?Rt("string"==typeof s.filter?s.filter:`${t.name}_filterColor_ext`):s.sampler?Ot("string"==typeof s.sampler?s.sampler:`${t.name}_sampleColor`):""}(s,i);return new zt(t,{id:`${o}-${r}`,module:s,fs:e})}))}(t,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){const s=this.passes,{target:o}=t;let i=t.inputBuffer,r=t.swapBuffer;for(let e=0;e<s.length;e++){const n=void 0!==o&&e===s.length-1;n&&(r=o);const a=!n||Boolean(t.clearCanvas),h={};h[this.module.name]={...this.props,...this.module.passes[e].uniforms},s[e].render({clearCanvas:a,inputBuffer:i,outputBuffer:r,moduleProps:h});const c=r;r=i,i=c}return i}cleanup(){if(this.passes){for(const t of this.passes)t.delete();this.passes=void 0}}}const Ct="#version 300 es\nuniform sampler2D texSrc;\n\nin vec2 position;\nin vec2 coordinate;\nin vec2 uv;\n\nout vec4 fragColor;\n",Rt=t=>`${Ct}\nvoid main() {\n fragColor = texture(texSrc, coordinate);\n fragColor = ${t}(fragColor, screen.texSize, coordinate);\n}\n`,Ot=t=>`${Ct}\nvoid main() {\n fragColor = ${t}(texSrc, screen.texSize, coordinate);\n}\n`,_t=Math.PI/180;function Xt({height:t,focalDistance:s,orbitAxis:o,rotationX:i,rotationOrbit:r,zoom:e}){const n="Z"===o?[0,0,1]:[0,1,0],a="Z"===o?[0,-s,0]:[0,0,s],h=(new F).lookAt({eye:a,up:n});h.rotateX(i*_t),"Z"===o?h.rotateZ(r*_t):h.rotateY(r*_t);const c=Math.pow(2,e)/t;return h.scale(c),h}class At extends D{constructor(t){const{height:s,projectionMatrix:o,fovy:i=50,orbitAxis:r="Z",target:e=[0,0,0],rotationX:n=0,rotationOrbit:a=0,zoom:h=0}=t,c=o?o[5]/2:V(i);super({...t,longitude:void 0,viewMatrix:Xt({height:s||1,focalDistance:c,orbitAxis:r,rotationX:n,rotationOrbit:a,zoom:h}),fovy:i,focalDistance:c,position:e,zoom:h}),this.target=e,this.orbitAxis=r,this.rotationX=n,this.rotationOrbit=a,this.fovy=i,this.projectedCenter=this.project(this.center)}unproject(t,{topLeft:s=!0}={}){const[o,i,r=this.projectedCenter[2]]=t,e=s?i:this.height-i,[n,a,h]=E([o,e,r],this.pixelUnprojectionMatrix);return[n,a,h]}panByPosition(t,s,o){const i=this.project(t);return{target:this.unproject([this.width/2+i[0]-s[0],this.height/2+i[1]-s[1],this.projectedCenter[2]])}}}At.displayName="OrbitViewport";const Lt=(new F).lookAt({eye:[0,0,1]});function jt({width:t,height:s,near:o,far:i,padding:r}){let e=-t/2,n=t/2,a=-s/2,c=s/2;if(r){const{left:o=0,right:i=0,top:u=0,bottom:l=0}=r,p=h((o+t-i)/2,0,t)-t/2,d=h((u+s-l)/2,0,s)-s/2;e-=p,n-=p,a+=d,c+=d}return(new F).ortho({left:e,right:n,bottom:a,top:c,near:o,far:i})}class Dt extends D{constructor(t){const{width:s,height:o,near:i=.1,far:r=1e3,zoom:e=0,target:n=[0,0,0],padding:a=null,flipY:h=!0}=t,c=t.zoomX??(Array.isArray(e)?e[0]:e),u=t.zoomY??(Array.isArray(e)?e[1]:e),l=Math.min(c,u),p=Math.pow(2,l);let d;if(c!==u){const t=Math.pow(2,c),s=Math.pow(2,u);d={unitsPerMeter:[t/p,s/p,1],metersPerUnit:[p/t,p/s,1]}}super({...t,longitude:void 0,position:n,viewMatrix:Lt.clone().scale([p,p*(h?-1:1),p]),projectionMatrix:jt({width:s||1,height:o||1,padding:a,near:i,far:r}),zoom:l,distanceScales:d}),this.target=n,this.zoomX=c,this.zoomY=u,this.flipY=h}projectFlat([t,s]){const{unitsPerMeter:o}=this.distanceScales;return[t*o[0],s*o[1]]}unprojectFlat([t,s]){const{metersPerUnit:o}=this.distanceScales;return[t*o[0],s*o[1]]}panByPosition(t,s,o){const i=E(s,this.pixelUnprojectionMatrix),r=this.projectFlat(t),e=f([],r,I([],i)),n=f([],this.center,e);return{target:this.unprojectFlat(n)}}}Dt.displayName="OrthographicViewport";class Vt extends D{constructor(t){const{longitude:s,latitude:o,modelMatrix:i,bearing:r=0,pitch:e=0,up:n=[0,0,1]}=t,a=new ot({bearing:r,pitch:-90===e?1e-4:90+e}).toVector3().normalize(),h=i?new F(i).transformAsVector(a):a,c=Number.isFinite(o)?T({latitude:o}):0,u=Math.pow(2,c),l=(new F).lookAt({eye:[0,0,0],center:h,up:n}).scale(u);super({...t,zoom:c,viewMatrix:l}),this.latitude=o,this.longitude=s,this.pitch=e,this.bearing=r,this.up=n}}Vt.displayName="FirstPersonViewport";class Et extends ${constructor(t){const{width:s,height:o,position:i=[0,0,0],bearing:r=0,pitch:e=0,longitude:n=null,latitude:a=null,maxPitch:h=90,minPitch:c=-90,startRotatePos:u,startBearing:l,startPitch:p,startZoomPosition:d,startPanPos:m,startPanPosition:g}=t;super({width:s,height:o,position:i,bearing:r,pitch:e,longitude:n,latitude:a,maxPitch:h,minPitch:c},{startRotatePos:u,startBearing:l,startPitch:p,startZoomPosition:d,startPanPos:m,startPanPosition:g}),this.makeViewport=t.makeViewport}panStart({pos:t}){const{position:s}=this.getViewportProps();return this._getUpdatedState({startPanPos:t,startPanPosition:s})}pan({pos:t}){if(!t)return this;const{startPanPos:s=[0,0],startPanPosition:o=[0,0]}=this.getState(),{width:i,height:r,bearing:e,pitch:n}=this.getViewportProps(),a=500*(t[0]-s[0])/i,h=500*(t[1]-s[1])/r,c=new ot({bearing:e,pitch:n}),l=new ot({bearing:e,pitch:-90}),p=c.toVector3().normalize(),d=l.toVector3().cross(p).normalize();return this._getUpdatedState({position:new u(o).add(d.scale(a)).add(p.scale(h))})}panEnd(){return this._getUpdatedState({startPanPos:null,startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:t,deltaAngleX:s=0,deltaAngleY:o=0}){const{startRotatePos:i,startBearing:r,startPitch:e}=this.getState(),{width:n,height:a}=this.getViewportProps();if(!i||void 0===r||void 0===e)return this;let h;return h=t?{bearing:r-(t[0]-i[0])/n*180,pitch:e-(t[1]-i[1])/a*90}:{bearing:r-s,pitch:e-o},this._getUpdatedState(h)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}zoom({pos:t,scale:s}){const o=this.getViewportProps(),i=this.getState().startZoomPosition||o.position,r=this.makeViewport(o),{projectionMatrix:e,width:n}=r,a=2*Math.atan(1/e[0])*(t[0]/n-.5),h=this.getDirection(!0);return this._move(h.rotateZ({radians:-a}),20*Math.log2(s),i)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null})}moveLeft(t=20){const s=this.getDirection(!0);return this._move(s.rotateZ({radians:Math.PI/2}),t)}moveRight(t=20){const s=this.getDirection(!0);return this._move(s.rotateZ({radians:-Math.PI/2}),t)}moveUp(t=20){const s=this.getDirection(!0);return this._move(s,t)}moveDown(t=20){const s=this.getDirection(!0);return this._move(s.negate(),t)}rotateLeft(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}zoomIn(t=20){return this._move(new u(0,0,1),t)}zoomOut(t=20){return this._move(new u(0,0,-1),t)}shortestPathFrom(t){const s=t.getViewportProps(),o={...this.getViewportProps()},{bearing:i,longitude:r}=o;return Math.abs(i-s.bearing)>180&&(o.bearing=i<0?i+360:i-360),null!==r&&null!==s.longitude&&Math.abs(r-s.longitude)>180&&(o.longitude=r<0?r+360:r-360),o}_move(t,s,o=this.getViewportProps().position){const i=t.scale(s);return this._getUpdatedState({position:new u(o).add(i)})}getDirection(t=!1){return new ot({bearing:this.getViewportProps().bearing,pitch:t?90:90+this.getViewportProps().pitch}).toVector3().normalize()}_getUpdatedState(t){return new Et({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){const{pitch:s,maxPitch:o,minPitch:i,longitude:r,bearing:e}=t;return t.pitch=h(s,i,o),null!==r&&(r<-180||r>180)&&(t.longitude=q(r+180,360)-180),(e<-180||e>180)&&(t.bearing=q(e+180,360)-180),t}}class Ft extends B{constructor(){super(...arguments),this.ControllerState=Et,this.transition={transitionDuration:300,transitionInterpolator:new N(["position","pitch","bearing"])}}}class It extends Y{constructor(t={}){super(t)}getViewportType(){return Vt}get ControllerType(){return Ft}}It.displayName="FirstPersonView";class Tt extends ${constructor(t){const{width:s,height:o,rotationX:i=0,rotationOrbit:r=0,target:e=[0,0,0],zoom:n=0,minRotationX:a=-90,maxRotationX:h=90,minZoom:c=-1/0,maxZoom:u=1/0,startPanPosition:l,startRotatePos:p,startRotationX:d,startRotationOrbit:m,startZoomPosition:g,startZoom:f}=t;super({width:s,height:o,rotationX:i,rotationOrbit:r,target:e,zoom:n,minRotationX:a,maxRotationX:h,minZoom:c,maxZoom:u},{startPanPosition:l,startRotatePos:p,startRotationX:d,startRotationOrbit:m,startZoomPosition:g,startZoom:f}),this.makeViewport=t.makeViewport}panStart({pos:t}){return this._getUpdatedState({startPanPosition:this._unproject(t)})}pan({pos:t,startPosition:s}){const o=this.getState().startPanPosition||s;if(!o)return this;const i=this.makeViewport(this.getViewportProps()).panByPosition(o,t);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate({pos:t,deltaAngleX:s=0,deltaAngleY:o=0}){const{startRotatePos:i,startRotationX:r,startRotationOrbit:e}=this.getState(),{width:n,height:a}=this.getViewportProps();if(!i||void 0===r||void 0===e)return this;let h;if(t){let s=(t[0]-i[0])/n;(r<-90||r>90)&&(s*=-1),h={rotationX:r+(t[1]-i[1])/a*180,rotationOrbit:e+180*s}}else h={rotationX:r+o,rotationOrbit:e+s};return this._getUpdatedState(h)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const s=t.getViewportProps(),o={...this.getViewportProps()},{rotationOrbit:i}=o;return Math.abs(i-s.rotationOrbit)>180&&(o.rotationOrbit=i<0?i+360:i-360),o}zoomStart({pos:t}){return this._getUpdatedState({startZoomPosition:this._unproject(t),startZoom:this.getViewportProps().zoom})}zoom({pos:t,startPos:s,scale:o}){let{startZoom:i,startZoomPosition:r}=this.getState();if(r||(i=this.getViewportProps().zoom,r=this._unproject(s||t)),!r)return this;const e=this._calculateNewZoom({scale:o,startZoom:i}),n=this.makeViewport({...this.getViewportProps(),zoom:e});return this._getUpdatedState({zoom:e,...n.panByPosition(r,t)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(t=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(t=50){return this._panFromCenter([-t,0])}moveRight(t=50){return this._panFromCenter([t,0])}moveUp(t=50){return this._panFromCenter([0,-t])}moveDown(t=50){return this._panFromCenter([0,t])}rotateLeft(t=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-t})}rotateRight(t=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+t})}rotateUp(t=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-t})}rotateDown(t=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+t})}_project(t){return this.makeViewport(this.getViewportProps()).project(t)}_unproject(t){return this.makeViewport(this.getViewportProps()).unproject(t)}_calculateNewZoom({scale:t,startZoom:s}){const{maxZoom:o,minZoom:i}=this.getViewportProps();void 0===s&&(s=this.getViewportProps().zoom);const r=s+Math.log2(t);return h(r,i,o)}_panFromCenter(t){const{target:s}=this.getViewportProps(),o=this._project(s);return this.pan({startPosition:s,pos:[o[0]+t[0],o[1]+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){const{maxZoom:s,minZoom:o,zoom:i,maxRotationX:r,minRotationX:e,rotationOrbit:n}=t;return t.zoom=Array.isArray(i)?[h(i[0],o,s),h(i[1],o,s)]:h(i,o,s),t.rotationX=h(t.rotationX,e,r),(n<-180||n>180)&&(t.rotationOrbit=q(n+180,360)-180),t}}class Bt extends B{constructor(){super(...arguments),this.ControllerState=Tt,this.transition={transitionDuration:300,transitionInterpolator:new N({transitionProps:{compare:["target","zoom","rotationX","rotationOrbit"],required:["target","zoom"]}})}}}class Nt extends Y{constructor(t={}){super(t),this.props.orbitAxis=t.orbitAxis||"Z"}getViewportType(){return At}get ControllerType(){return Bt}}Nt.displayName="OrbitView";class $t extends Tt{constructor(t){super(t),this.zoomAxis=t.zoomAxis||"all"}_calculateNewZoom({scale:t,startZoom:s}){const{maxZoom:o,minZoom:i}=this.getViewportProps();void 0===s&&(s=this.getViewportProps().zoom);let r=Math.log2(t);if(Array.isArray(s)){let[t,e]=s;switch(this.zoomAxis){case"X":t=h(t+r,i,o);break;case"Y":e=h(e+r,i,o);break;default:let s=Math.min(t+r,e+r);s<i&&(r+=i-s),s=Math.max(t+r,e+r),s>o&&(r+=o-s),t+=r,e+=r}return[t,e]}return h(s+r,i,o)}}class kt extends B{constructor(){super(...arguments),this.ControllerState=$t,this.transition={transitionDuration:300,transitionInterpolator:new N(["target","zoom"])},this.dragMode="pan"}_onPanRotate(){return!1}}class Ut extends Y{constructor(t={}){super(t)}getViewportType(){return Dt}get ControllerType(){return kt}}Ut.displayName="OrthographicView";class qt extends G{constructor(t){const{startPanPos:s,...o}=t;super(o),void 0!==s&&(this._state.startPanPos=s)}panStart({pos:t}){const{latitude:s,longitude:o,zoom:i}=this.getViewportProps();return this._getUpdatedState({startPanLngLat:[o,s],startPanPos:t,startZoom:i})}pan({pos:t,startPos:s}){const o=this.getState(),i=o.startPanLngLat||this._unproject(s);if(!i)return this;const r=o.startZoom??this.getViewportProps().zoom,e=o.startPanPos||s,n=[i[0],i[1],r],a=this.makeViewport(this.getViewportProps()).panByPosition(n,t,e);return this._getUpdatedState(a)}panEnd(){return this._getUpdatedState({startPanLngLat:null,startPanPos:null,startZoom:null})}zoom({scale:t}){const s=(this.getState().startZoom||this.getViewportProps().zoom)+Math.log2(t);return this._getUpdatedState({zoom:s})}applyConstraints(t){const{longitude:s,latitude:o,maxZoom:i,minZoom:r,zoom:e}=t,n=J(0),a=J(o)-n;return t.zoom=h(e,r+a,i+a),(s<-180||s>180)&&(t.longitude=q(s+180,360)-180),t.latitude=h(o,-Q,Q),t}}class Yt extends B{constructor(){super(...arguments),this.ControllerState=qt,this.transition={transitionDuration:300,transitionInterpolator:new N(["longitude","latitude","zoom"])},this.dragMode="pan"}setProps(t){super.setProps(t),this.dragRotate=!1,this.touchRotate=!1}}class Gt extends Y{constructor(t={}){super(t)}getViewportType(t){return t.zoom>12?H:W}get ControllerType(){return Yt}}Gt.displayName="GlobeView";const Qt={bearing:0,pitch:0,position:[0,0,0]},Jt={speed:1.2,curve:1.414};class Ht extends K{constructor(t={}){super({compare:["longitude","latitude","zoom","bearing","pitch","position"],extract:["width","height","longitude","latitude","zoom","bearing","pitch","position"],required:["width","height","latitude","longitude","zoom"]}),this.opts={...Jt,...t}}interpolateProps(t,s,o){const i=function(t,s,o,i){const{startZoom:r,startCenterXY:e,uDelta:n,w0:a,u1:h,S:c,rho:u,rho2:l,r0:p}=et(t,s,i);if(h<.01){const i={};for(const r of it)i[r]=m(t[r],s[r],o);return i}const d=o*c,M=Math.cosh(p)/Math.cosh(p+u*d),v=a*((Math.cosh(p)*Math.tanh(p+u*d)-Math.sinh(p))/l)/h,b=r+w(1/M),x=g([],n,v);f(x,x,e);const y=P(x);return{longitude:y[0],latitude:y[1],zoom:b}}(t,s,o,this.opts);for(const r in Qt)i[r]=tt(t[r]||Qt[r],s[r]||Qt[r],o);return i}getDuration(t,s){let{transitionDuration:o}=s;return"auto"===o&&(o=function(t,s,o){const i={...rt,...o},{screenSpeed:r,speed:e,maxDuration:n}=i,{S:a,rho:h}=et(t,s,i),c=1e3*a;let u;return u=Number.isFinite(r)?c/(r/h):c/e,Number.isFinite(n)&&u>n?0:u}(t,s,this.opts)),o}}export{S as COORDINATE_SYSTEM,B as Controller,Z as DirectionalLight,Ft as FirstPersonController,It as FirstPersonView,Vt as FirstPersonViewport,Ht as FlyToInterpolator,N as LinearInterpolator,Bt as OrbitController,Nt as OrbitView,At as OrbitViewport,kt as OrthographicController,Ut as OrthographicView,Dt as OrthographicViewport,pt as PointLight,Zt as PostProcessEffect,K as TransitionInterpolator,Y as View,D as Viewport,H as WebMercatorViewport,dt as _CameraLight,Yt as _GlobeController,Gt as _GlobeView,W as _GlobeViewport,bt as _SunLight}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,p as t,a as n,U as i,M as o,c as s,i as a,G as r,j as l,m as c,W as g,k as d,C as u,r as f,l as p,n as h,f as m,P as v}from"./p-MyTSFnEk.js";const x="uniform arcUniforms {\n bool greatCircle;\n bool useShortestPath;\n float numSegments;\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n highp int widthUnits;\n} arc;\n",y={name:"arc",vs:x,fs:x,uniformTypes:{greatCircle:"f32",useShortestPath:"f32",numSegments:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",widthUnits:"i32"}},P=[0,0,0,255],_={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getSourceColor:{type:"accessor",value:P},getTargetColor:{type:"accessor",value:P},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,numSegments:{type:"number",value:50,min:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class C extends e{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME arc-layer-vertex-shader\nin vec4 instanceSourceColors;\nin vec4 instanceTargetColors;\nin vec3 instanceSourcePositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions;\nin vec3 instanceTargetPositions64Low;\nin vec3 instancePickingColors;\nin float instanceWidths;\nin float instanceHeights;\nin float instanceTilts;\nout vec4 vColor;\nout vec2 uv;\nout float isValid;\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\nfloat deltaZ = targetZ - sourceZ;\nfloat dh = distance * instanceHeights;\nif (dh == 0.0) {\nreturn sourceZ + deltaZ * ratio;\n}\nfloat unitZ = deltaZ / dh;\nfloat p2 = unitZ * unitZ + 1.0;\nfloat dir = step(deltaZ, 0.0);\nfloat z0 = mix(sourceZ, targetZ, dir);\nfloat r = mix(ratio, 1.0 - ratio, dir);\nreturn sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project.viewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (arc.numSegments - 1.0));\n}\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\nfloat distance = length(source.xy - target.xy);\nfloat z = paraboloid(distance, source.z, target.z, segmentRatio);\nfloat tiltAngle = radians(instanceTilts);\nvec2 tiltDirection = normalize(target.xy - source.xy);\nvec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\nreturn vec3(\nmix(source.xy, target.xy, segmentRatio) + tilt,\nz * cos(tiltAngle)\n);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 sourceRadians = radians(source);\nvec2 targetRadians = radians(target);\nvec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\nvec2 shd_sq = sin_half_delta * sin_half_delta;\nfloat a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\nreturn 2.0 * asin(sqrt(a));\n}\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\nvec2 lngLat;\nif(abs(angularDist - PI) < 0.001) {\nlngLat = (1.0 - t) * source.xy + t * target.xy;\n} else {\nfloat a = sin((1.0 - t) * angularDist);\nfloat b = sin(t * angularDist);\nvec3 p = source3D.yxz * a + target3D.yxz * b;\nlngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n}\nfloat z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\nreturn vec3(lngLat, z);\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nfloat segmentIndex = float(gl_VertexID / 2);\nfloat segmentSide = mod(float(gl_VertexID), 2.) == 0. ? -1. : 1.;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\nfloat nextSegmentRatio = getSegmentRatio(min(arc.numSegments - 1.0, segmentIndex + 1.0));\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nisValid = 1.0;\nuv = vec2(segmentRatio, segmentSide);\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nvec4 curr;\nvec4 next;\nvec3 source;\nvec3 target;\nif ((arc.greatCircle || project.projectionMode == PROJECTION_MODE_GLOBE) && project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nsource = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\ntarget = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\nfloat angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\nvec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\nvec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\nvec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\nif (abs(currPos.x - prevPos.x) > 180.0) {\nindexDir = -1.0;\nisValid = 0.0;\n} else if (abs(currPos.x - nextPos.x) > 180.0) {\nindexDir = 1.0;\nisValid = 0.0;\n}\nnextPos = indexDir < 0.0 ? prevPos : nextPos;\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nif (isValid == 0.0) {\nnextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\nfloat t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\ncurrPos = mix(currPos, nextPos, t);\nsegmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n}\nvec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\nvec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\ncurr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\nnext = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n} else {\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nif (arc.useShortestPath) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng > 180.) target_world.x -= 360.;\nif (deltaLng < -180.) source_world.x -= 360.;\n}\nsource = project_position(source_world, instanceSourcePositions64Low);\ntarget = project_position(target_world, instanceTargetPositions64Low);\nfloat antiMeridianX = 0.0;\nif (arc.useShortestPath) {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nantiMeridianX = -(project.coordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n}\nfloat thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\nif (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\nisValid = 0.0;\nindexDir = sign(segmentRatio - thresholdRatio);\nsegmentRatio = thresholdRatio;\n}\n}\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nvec3 currPos = interpolateFlat(source, target, segmentRatio);\nvec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\nif (arc.useShortestPath) {\nif (nextPos.x < antiMeridianX) {\ncurrPos.x += TILE_SIZE;\nnextPos.x += TILE_SIZE;\n}\n}\ncurr = project_common_position_to_clipspace(vec4(currPos, 1.0));\nnext = project_common_position_to_clipspace(vec4(nextPos, 1.0));\ngeometry.position = vec4(currPos, 1.0);\n}\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * arc.widthScale, arc.widthUnits),\narc.widthMinPixels, arc.widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset((next.xy - curr.xy) * indexDir, segmentSide, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(curr, geometry);\ngl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\nvColor = vec4(color.rgb, color.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME arc-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nin float isValid;\nout vec4 fragColor;\nvoid main(void) {\nif (isValid == 0.0) {\ndiscard;\n}\nfragColor = vColor;\ngeometry.uv = uv;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[t,n,y]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getSourceColor",defaultValue:P},instanceTargetColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getTargetColor",defaultValue:P},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({}){const{widthUnits:e,widthScale:t,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,wrapLongitude:a,numSegments:r}=this.props,l=this.state.model;l.shaderInputs.setProps({arc:{numSegments:r,widthUnits:i[e],widthScale:t,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,useShortestPath:a}}),l.setVertexCount(2*r),l.draw(this.context.renderPass)}_getModel(){return new o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:"triangle-strip",isInstanced:!0})}}C.layerName="ArcLayer",C.defaultProps=_;const S="uniform pointCloudUniforms {\n float radiusPixels;\n highp int sizeUnits;\n} pointCloud;\n",w={name:"pointCloud",source:"struct PointCloudUniforms {\n radiusPixels: f32,\n sizeUnits: i32,\n};\n\n@group(0) @binding(3)\nvar<uniform> pointCloud: PointCloudUniforms;\n",vs:S,fs:S,uniformTypes:{radiusPixels:"f32",sizeUnits:"i32"}},L=[0,0,0,255],R=[0,0,1],E={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:e=>e.position},getNormal:{type:"accessor",value:R},getColor:{type:"accessor",value:L},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class T extends e{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceNormals;\nin vec4 instanceColors;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec3 instancePickingColors;\nout vec4 vColor;\nout vec2 unitPosition;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.normal = project_normal(instanceNormals);\nunitPosition = positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\nvec3 offset = vec3(positions.xy * project_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\nvec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, instanceColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 unitPosition;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition.xy;\nfloat distToCenter = length(unitPosition);\nif (distToCenter > 1.0) {\ndiscard;\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",source:"struct ConstantAttributes {\n instanceNormals: vec3<f32>,\n instanceColors: vec4<f32>,\n instancePositions: vec3<f32>,\n instancePositions64Low: vec3<f32>,\n instancePickingColors: vec3<f32>\n};\n\nconst constants = ConstantAttributes(\n vec3<f32>(1.0, 0.0, 0.0),\n vec4<f32>(0.0, 0.0, 0.0, 1.0),\n vec3<f32>(0.0),\n vec3<f32>(0.0),\n vec3<f32>(0.0)\n);\n\nstruct Attributes {\n @builtin(instance_index) instanceIndex : u32,\n @builtin(vertex_index) vertexIndex : u32,\n @location(0) positions: vec3<f32>,\n @location(1) instancePositions: vec3<f32>,\n @location(2) instancePositions64Low: vec3<f32>,\n @location(3) instanceNormals: vec3<f32>,\n @location(4) instanceColors: vec4<f32>,\n @location(5) instancePickingColors: vec3<f32>\n};\n\nstruct Varyings {\n @builtin(position) position: vec4<f32>,\n @location(0) vColor: vec4<f32>,\n @location(1) unitPosition: vec2<f32>,\n};\n\n@vertex\nfn vertexMain(attributes: Attributes) -> Varyings {\n var varyings: Varyings;\n \n // var geometry: Geometry;\n // geometry.worldPosition = instancePositions;\n // geometry.normal = project_normal(instanceNormals);\n\n // position on the containing square in [-1, 1] space\n varyings.unitPosition = attributes.positions.xy;\n geometry.uv = varyings.unitPosition;\n geometry.pickingColor = attributes.instancePickingColors;\n\n // Find the center of the point and add the current vertex\n let offset = vec3<f32>(attributes.positions.xy * project_unit_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\n // DECKGL_FILTER_SIZE(offset, geometry);\n\n varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, vec3<f32>(0.0)); // TODO , geometry.position);\n // DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n let clipPixels = project_pixel_size_to_clipspace(offset.xy);\n varyings.position.x += clipPixels.x;\n varyings.position.y += clipPixels.y;\n\n // Apply lighting\n let lightColor = lighting_getLightColor2(attributes.instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\n\n // Apply opacity to instance color, or return instance picking color\n varyings.vColor = vec4(lightColor, attributes.instanceColors.a * color.opacity);\n // DECKGL_FILTER_COLOR(vColor, geometry);\n\n return varyings;\n}\n\n@fragment\nfn fragmentMain(varyings: Varyings) -> @location(0) vec4<f32> {\n // var geometry: Geometry;\n // geometry.uv = unitPosition.xy;\n\n let distToCenter = length(varyings.unitPosition);\n if (distToCenter > 1.0) {\n discard;\n }\n\n var fragColor: vec4<f32>;\n\n fragColor = varyings.vColor;\n // DECKGL_FILTER_COLOR(fragColor, geometry);\n\n // Apply premultiplied alpha as required by transparent canvas\n fragColor = deckgl_premultiplied_alpha(fragColor);\n\n return fragColor;\n}\n",modules:[t,s,a,n,w]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:R},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:L}})}updateState(e){const{changeFlags:t,props:n}=e;super.updateState(e),t.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll()),t.dataChanged&&function(e){const{header:t,attributes:n}=e;if(t&&n&&(e.length=t.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0)){const{size:e,value:t}=n.COLOR_0;n.instanceColors={size:e,type:"unorm8",value:t}}}(n.data)}draw({}){const{pointSize:e,sizeUnits:t}=this.props,n=this.state.model;n.shaderInputs.setProps({pointCloud:{sizeUnits:i[t],radiusPixels:e}}),"webgpu"===this.context.device.type&&(n.instanceCount=this.props.data.length),n.draw(this.context.renderPass)}_getModel(){const e="webgpu"===this.context.device.type?{depthWriteEnabled:!0,depthCompare:"less-equal"}:void 0,t=[];for(let e=0;e<3;e++){const n=e/3*Math.PI*2;t.push(2*Math.cos(n),2*Math.sin(n),0)}return new o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new r({topology:"triangle-list",attributes:{positions:new Float32Array(t)}}),parameters:e,isInstanced:!0})}}T.layerName="PointCloudLayer",T.defaultProps=E;class z extends r{constructor(e){const{indices:t,attributes:n}=function(e){const{radius:t,height:n=1,nradial:i=10}=e;let{vertices:o}=e;o&&(l.assert(o.length>=i),o=o.flatMap((e=>[e[0],e[1]])),c(o,g.COUNTER_CLOCKWISE));const s=n>0,a=i+1,r=s?3*a+1:i,d=2*Math.PI/i,u=new Uint16Array(s?3*i*2:0),f=new Float32Array(3*r),p=new Float32Array(3*r);let h=0;if(s){for(let e=0;e<a;e++){const s=e*d,a=e%i,r=Math.sin(s),l=Math.cos(s);for(let e=0;e<2;e++)f[h+0]=o?o[2*a]:l*t,f[h+1]=o?o[2*a+1]:r*t,f[h+2]=(.5-e)*n,p[h+0]=o?o[2*a]:l,p[h+1]=o?o[2*a+1]:r,h+=3}f[h+0]=f[h-3],f[h+1]=f[h-2],f[h+2]=f[h-1],h+=3}for(let e=s?0:1;e<a;e++){const s=Math.floor(e/2)*Math.sign(.5-e%2),a=s*d,r=(s+i)%i,l=Math.sin(a),c=Math.cos(a);f[h+0]=o?o[2*r]:c*t,f[h+1]=o?o[2*r+1]:l*t,f[h+2]=n/2,p[h+2]=1,h+=3}if(s){let e=0;for(let t=0;t<i;t++)u[e++]=2*t+0,u[e++]=2*t+2,u[e++]=2*t+0,u[e++]=2*t+1,u[e++]=2*t+1,u[e++]=2*t+3}return{indices:u,attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:p}}}}(e);super({...e,indices:t,attributes:n})}}const D="uniform columnUniforms {\n float radius;\n float angle;\n vec2 offset;\n bool extruded;\n bool stroked;\n bool isStroke;\n float coverage;\n float elevationScale;\n float edgeDistance;\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n highp int radiusUnits;\n highp int widthUnits;\n} column;\n",M={name:"column",vs:D,fs:D,uniformTypes:{radius:"f32",angle:"f32",offset:"vec2<f32>",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},b=[0,0,0,255],I={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:e=>e.position},getFillColor:{type:"accessor",value:b},getLineColor:{type:"accessor",value:b},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class O extends e{getShaders(){const e={},{flatShading:i}=this.props;return i&&(e.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME column-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\nin vec3 instancePickingColors;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec3 cameraPosition;\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nvec4 color = column.isStroke ? instanceLineColors : instanceFillColors;\nmat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle));\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (column.extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale;\n} else if (column.stroked) {\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits),\ncolumn.widthMinPixels, column.widthMaxPixels) / 2.0;\nfloat halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius);\nif (column.isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat dotRadius = column.radius * column.coverage * shouldRender;\ngeometry.pickingColor = instancePickingColors;\nvec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\nvec3 centroidPosition64Low = instancePositions64Low;\nvec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius;\nif (column.radiusUnits == UNIT_METERS) {\noffset = project_size(offset);\n} else if (column.radiusUnits == UNIT_PIXELS) {\noffset = project_pixel_size(offset);\n}\nvec3 pos = vec3(offset, 0.);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\ngeometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (column.extruded && !column.isStroke) {\n#ifdef FLAT_SHADING\ncameraPosition = project.cameraPosition;\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * layer.opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * layer.opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * layer.opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\nprecision highp float;\nout vec4 fragColor;\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n#endif\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\n#ifdef FLAT_SHADING\nif (column.extruded && !column.isStroke && !bool(picking.isActive)) {\nvec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\nfragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n}\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:e,modules:[t,i?d:a,n,M]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:b},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:b},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){super.updateState(e);const{props:t,oldProps:n,changeFlags:i}=e,o=i.extensionsChanged||t.flatShading!==n.flatShading;o&&(this.state.models?.forEach((e=>e.destroy())),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const s=this.getNumInstances();this.state.fillModel.setInstanceCount(s),this.state.wireframeModel.setInstanceCount(s),(o||t.diskResolution!==n.diskResolution||t.vertices!==n.vertices||(t.extruded||t.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(t)}getGeometry(e,t,n){const i=new z({radius:1,height:n?2:0,vertices:t,nradial:e});let o=0;if(t)for(let n=0;n<e;n++){const i=t[n];o+=Math.sqrt(i[0]*i[0]+i[1]*i[1])/e}else o=1;return this.setState({edgeDistance:Math.cos(Math.PI/e)*o}),i}_getModels(){const e=this.getShaders(),t=this.getAttributeManager().getBufferLayouts(),n=new o(this.context.device,{...e,id:`${this.props.id}-fill`,bufferLayout:t,isInstanced:!0}),i=new o(this.context.device,{...e,id:`${this.props.id}-wireframe`,bufferLayout:t,isInstanced:!0});return{fillModel:n,wireframeModel:i,models:[i,n]}}_updateGeometry({diskResolution:e,vertices:t,extruded:n,stroked:i}){const o=this.getGeometry(e,t,n||i);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3});const s=this.state.fillModel,a=this.state.wireframeModel;s.setGeometry(o),s.setTopology("triangle-strip"),s.setIndexBuffer(null),a.setGeometry(o),a.setTopology("line-list")}draw({}){const{lineWidthUnits:e,lineWidthScale:t,lineWidthMinPixels:n,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:a,extruded:r,filled:l,stroked:c,wireframe:g,offset:d,coverage:u,radius:f,angle:p}=this.props,h=this.state.fillModel,m=this.state.wireframeModel,{fillVertexCount:v,edgeDistance:x}=this.state,y={radius:f,angle:p/180*Math.PI,offset:d,extruded:r,stroked:c,coverage:u,elevationScale:a,edgeDistance:x,radiusUnits:i[s],widthUnits:i[e],widthScale:t,widthMinPixels:n,widthMaxPixels:o};r&&g&&(m.shaderInputs.setProps({column:{...y,isStroke:!0}}),m.draw(this.context.renderPass)),l&&(h.setVertexCount(v),h.shaderInputs.setProps({column:{...y,isStroke:!1}}),h.draw(this.context.renderPass)),!r&&c&&(h.setVertexCount(2*v/3),h.shaderInputs.setProps({column:{...y,isStroke:!0}}),h.draw(this.context.renderPass))}}O.layerName="ColumnLayer",O.defaultProps=I;const A=[0,0,0,255],F={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:e=>e.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:A},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class k extends u{initializeState(){this.state={paths:[],pathsDiff:null},this.props.getLineDashArray&&l.removed("getLineDashArray","PathStyleExtension")()}updateState({changeFlags:e}){const t=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(t&&Array.isArray(e.dataChanged)){const t=this.state.paths.slice(),n=e.dataChanged.map((e=>f({data:t,getIndex:e=>e.__source.index,dataRange:e,replace:this._getPaths(e)})));this.setState({paths:t,pathsDiff:n})}else t&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(e={}){const{data:t,getPolygon:n,positionFormat:i,_normalize:o}=this.props,s=[],a="XY"===i?2:3,{startRow:r,endRow:l}=e,{iterable:c,objectInfo:g}=p(t,r,l);for(const e of c){g.index++;let t=n(e,g);o&&(t=h(t,a));const{holeIndices:i}=t,r=t.positions||t;if(i)for(let t=0;t<=i.length;t++){const n=r.slice(i[t-1]||0,i[t]||r.length);s.push(this.getSubLayerRow({path:n},e,g.index))}else s.push(this.getSubLayerRow({path:r},e,g.index))}return s}renderLayers(){const{data:e,_dataDiff:t,stroked:n,filled:i,extruded:o,wireframe:s,_normalize:a,_windingOrder:r,elevationScale:l,transitions:c,positionFormat:g}=this.props,{lineWidthUnits:d,lineWidthScale:u,lineWidthMinPixels:f,lineWidthMaxPixels:p,lineJointRounded:h,lineMiterLimit:x,lineDashJustified:y}=this.props,{getFillColor:P,getLineColor:_,getLineWidth:C,getLineDashArray:S,getElevation:w,getPolygon:L,updateTriggers:R,material:E}=this.props,{paths:T,pathsDiff:z}=this.state,D=this.getSubLayerClass("fill",m),M=this.getSubLayerClass("stroke",v),b=this.shouldRenderSubLayer("fill",T)&&new D({_dataDiff:t,extruded:o,elevationScale:l,filled:i,wireframe:s,_normalize:a,_windingOrder:r,getElevation:w,getFillColor:P,getLineColor:o&&s?_:A,material:E,transitions:c},this.getSubLayerProps({id:"fill",updateTriggers:R&&{getPolygon:R.getPolygon,getElevation:R.getElevation,getFillColor:R.getFillColor,lineColors:o&&s,getLineColor:R.getLineColor}}),{data:e,positionFormat:g,getPolygon:L});return[!o&&b,!o&&n&&this.shouldRenderSubLayer("stroke",T)&&new M({_dataDiff:z&&(()=>z),widthUnits:d,widthScale:u,widthMinPixels:f,widthMaxPixels:p,jointRounded:h,miterLimit:x,dashJustified:y,_pathType:"loop",transitions:c&&{getWidth:c.getLineWidth,getColor:c.getLineColor,getPath:c.getPolygon},getColor:this.getSubLayerAccessor(_),getWidth:this.getSubLayerAccessor(C),getDashArray:this.getSubLayerAccessor(S)},this.getSubLayerProps({id:"stroke",updateTriggers:R&&{getWidth:R.getLineWidth,getColor:R.getLineColor,getDashArray:R.getLineDashArray}}),{data:T,positionFormat:g,getPath:e=>e.path}),o&&b]}}k.layerName="PolygonLayer",k.defaultProps=F;export{C as A,O as C,T as P,k as a}
|
|
1
|
+
import{L as e,p as t,a as n,U as i,M as o,c as s,i as a,G as r,j as l,m as c,W as g,k as d,C as u,r as f,l as p,n as h,f as m,P as v}from"./p-9Rt23jlQ.js";const x="uniform arcUniforms {\n bool greatCircle;\n bool useShortestPath;\n float numSegments;\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n highp int widthUnits;\n} arc;\n",y={name:"arc",vs:x,fs:x,uniformTypes:{greatCircle:"f32",useShortestPath:"f32",numSegments:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",widthUnits:"i32"}},P=[0,0,0,255],_={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getSourceColor:{type:"accessor",value:P},getTargetColor:{type:"accessor",value:P},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,numSegments:{type:"number",value:50,min:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class C extends e{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME arc-layer-vertex-shader\nin vec4 instanceSourceColors;\nin vec4 instanceTargetColors;\nin vec3 instanceSourcePositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions;\nin vec3 instanceTargetPositions64Low;\nin vec3 instancePickingColors;\nin float instanceWidths;\nin float instanceHeights;\nin float instanceTilts;\nout vec4 vColor;\nout vec2 uv;\nout float isValid;\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\nfloat deltaZ = targetZ - sourceZ;\nfloat dh = distance * instanceHeights;\nif (dh == 0.0) {\nreturn sourceZ + deltaZ * ratio;\n}\nfloat unitZ = deltaZ / dh;\nfloat p2 = unitZ * unitZ + 1.0;\nfloat dir = step(deltaZ, 0.0);\nfloat z0 = mix(sourceZ, targetZ, dir);\nfloat r = mix(ratio, 1.0 - ratio, dir);\nreturn sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project.viewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nfloat getSegmentRatio(float index) {\nreturn smoothstep(0.0, 1.0, index / (arc.numSegments - 1.0));\n}\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\nfloat distance = length(source.xy - target.xy);\nfloat z = paraboloid(distance, source.z, target.z, segmentRatio);\nfloat tiltAngle = radians(instanceTilts);\nvec2 tiltDirection = normalize(target.xy - source.xy);\nvec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\nreturn vec3(\nmix(source.xy, target.xy, segmentRatio) + tilt,\nz * cos(tiltAngle)\n);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\nvec2 sourceRadians = radians(source);\nvec2 targetRadians = radians(target);\nvec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\nvec2 shd_sq = sin_half_delta * sin_half_delta;\nfloat a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\nreturn 2.0 * asin(sqrt(a));\n}\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\nvec2 lngLat;\nif(abs(angularDist - PI) < 0.001) {\nlngLat = (1.0 - t) * source.xy + t * target.xy;\n} else {\nfloat a = sin((1.0 - t) * angularDist);\nfloat b = sin(t * angularDist);\nvec3 p = source3D.yxz * a + target3D.yxz * b;\nlngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n}\nfloat z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\nreturn vec3(lngLat, z);\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nfloat segmentIndex = float(gl_VertexID / 2);\nfloat segmentSide = mod(float(gl_VertexID), 2.) == 0. ? -1. : 1.;\nfloat segmentRatio = getSegmentRatio(segmentIndex);\nfloat prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\nfloat nextSegmentRatio = getSegmentRatio(min(arc.numSegments - 1.0, segmentIndex + 1.0));\nfloat indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\nisValid = 1.0;\nuv = vec2(segmentRatio, segmentSide);\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nvec4 curr;\nvec4 next;\nvec3 source;\nvec3 target;\nif ((arc.greatCircle || project.projectionMode == PROJECTION_MODE_GLOBE) && project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\nsource = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\ntarget = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\nfloat angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\nvec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\nvec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\nvec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\nif (abs(currPos.x - prevPos.x) > 180.0) {\nindexDir = -1.0;\nisValid = 0.0;\n} else if (abs(currPos.x - nextPos.x) > 180.0) {\nindexDir = 1.0;\nisValid = 0.0;\n}\nnextPos = indexDir < 0.0 ? prevPos : nextPos;\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nif (isValid == 0.0) {\nnextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\nfloat t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\ncurrPos = mix(currPos, nextPos, t);\nsegmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n}\nvec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\nvec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\ncurr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\nnext = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n} else {\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nif (arc.useShortestPath) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng > 180.) target_world.x -= 360.;\nif (deltaLng < -180.) source_world.x -= 360.;\n}\nsource = project_position(source_world, instanceSourcePositions64Low);\ntarget = project_position(target_world, instanceTargetPositions64Low);\nfloat antiMeridianX = 0.0;\nif (arc.useShortestPath) {\nif (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\nantiMeridianX = -(project.coordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n}\nfloat thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\nif (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\nisValid = 0.0;\nindexDir = sign(segmentRatio - thresholdRatio);\nsegmentRatio = thresholdRatio;\n}\n}\nnextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\nvec3 currPos = interpolateFlat(source, target, segmentRatio);\nvec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\nif (arc.useShortestPath) {\nif (nextPos.x < antiMeridianX) {\ncurrPos.x += TILE_SIZE;\nnextPos.x += TILE_SIZE;\n}\n}\ncurr = project_common_position_to_clipspace(vec4(currPos, 1.0));\nnext = project_common_position_to_clipspace(vec4(nextPos, 1.0));\ngeometry.position = vec4(currPos, 1.0);\n}\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * arc.widthScale, arc.widthUnits),\narc.widthMinPixels, arc.widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset((next.xy - curr.xy) * indexDir, segmentSide, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(curr, geometry);\ngl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\nvColor = vec4(color.rgb, color.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME arc-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nin float isValid;\nout vec4 fragColor;\nvoid main(void) {\nif (isValid == 0.0) {\ndiscard;\n}\nfragColor = vColor;\ngeometry.uv = uv;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[t,n,y]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getSourceColor",defaultValue:P},instanceTargetColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getTargetColor",defaultValue:P},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({}){const{widthUnits:e,widthScale:t,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,wrapLongitude:a,numSegments:r}=this.props,l=this.state.model;l.shaderInputs.setProps({arc:{numSegments:r,widthUnits:i[e],widthScale:t,widthMinPixels:n,widthMaxPixels:o,greatCircle:s,useShortestPath:a}}),l.setVertexCount(2*r),l.draw(this.context.renderPass)}_getModel(){return new o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:"triangle-strip",isInstanced:!0})}}C.layerName="ArcLayer",C.defaultProps=_;const S="uniform pointCloudUniforms {\n float radiusPixels;\n highp int sizeUnits;\n} pointCloud;\n",w={name:"pointCloud",source:"struct PointCloudUniforms {\n radiusPixels: f32,\n sizeUnits: i32,\n};\n\n@group(0) @binding(3)\nvar<uniform> pointCloud: PointCloudUniforms;\n",vs:S,fs:S,uniformTypes:{radiusPixels:"f32",sizeUnits:"i32"}},L=[0,0,0,255],R=[0,0,1],E={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:e=>e.position},getNormal:{type:"accessor",value:R},getColor:{type:"accessor",value:L},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class T extends e{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceNormals;\nin vec4 instanceColors;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec3 instancePickingColors;\nout vec4 vColor;\nout vec2 unitPosition;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.normal = project_normal(instanceNormals);\nunitPosition = positions.xy;\ngeometry.uv = unitPosition;\ngeometry.pickingColor = instancePickingColors;\nvec3 offset = vec3(positions.xy * project_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\ngl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\nvec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, instanceColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME point-cloud-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 unitPosition;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = unitPosition.xy;\nfloat distToCenter = length(unitPosition);\nif (distToCenter > 1.0) {\ndiscard;\n}\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",source:"struct ConstantAttributes {\n instanceNormals: vec3<f32>,\n instanceColors: vec4<f32>,\n instancePositions: vec3<f32>,\n instancePositions64Low: vec3<f32>,\n instancePickingColors: vec3<f32>\n};\n\nconst constants = ConstantAttributes(\n vec3<f32>(1.0, 0.0, 0.0),\n vec4<f32>(0.0, 0.0, 0.0, 1.0),\n vec3<f32>(0.0),\n vec3<f32>(0.0),\n vec3<f32>(0.0)\n);\n\nstruct Attributes {\n @builtin(instance_index) instanceIndex : u32,\n @builtin(vertex_index) vertexIndex : u32,\n @location(0) positions: vec3<f32>,\n @location(1) instancePositions: vec3<f32>,\n @location(2) instancePositions64Low: vec3<f32>,\n @location(3) instanceNormals: vec3<f32>,\n @location(4) instanceColors: vec4<f32>,\n @location(5) instancePickingColors: vec3<f32>\n};\n\nstruct Varyings {\n @builtin(position) position: vec4<f32>,\n @location(0) vColor: vec4<f32>,\n @location(1) unitPosition: vec2<f32>,\n};\n\n@vertex\nfn vertexMain(attributes: Attributes) -> Varyings {\n var varyings: Varyings;\n \n // var geometry: Geometry;\n // geometry.worldPosition = instancePositions;\n // geometry.normal = project_normal(instanceNormals);\n\n // position on the containing square in [-1, 1] space\n varyings.unitPosition = attributes.positions.xy;\n geometry.uv = varyings.unitPosition;\n geometry.pickingColor = attributes.instancePickingColors;\n\n // Find the center of the point and add the current vertex\n let offset = vec3<f32>(attributes.positions.xy * project_unit_size_to_pixel(pointCloud.radiusPixels, pointCloud.sizeUnits), 0.0);\n // DECKGL_FILTER_SIZE(offset, geometry);\n\n varyings.position = project_position_to_clipspace(attributes.instancePositions, attributes.instancePositions64Low, vec3<f32>(0.0)); // TODO , geometry.position);\n // DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n let clipPixels = project_pixel_size_to_clipspace(offset.xy);\n varyings.position.x += clipPixels.x;\n varyings.position.y += clipPixels.y;\n\n // Apply lighting\n let lightColor = lighting_getLightColor2(attributes.instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\n\n // Apply opacity to instance color, or return instance picking color\n varyings.vColor = vec4(lightColor, attributes.instanceColors.a * color.opacity);\n // DECKGL_FILTER_COLOR(vColor, geometry);\n\n return varyings;\n}\n\n@fragment\nfn fragmentMain(varyings: Varyings) -> @location(0) vec4<f32> {\n // var geometry: Geometry;\n // geometry.uv = unitPosition.xy;\n\n let distToCenter = length(varyings.unitPosition);\n if (distToCenter > 1.0) {\n discard;\n }\n\n var fragColor: vec4<f32>;\n\n fragColor = varyings.vColor;\n // DECKGL_FILTER_COLOR(fragColor, geometry);\n\n // Apply premultiplied alpha as required by transparent canvas\n fragColor = deckgl_premultiplied_alpha(fragColor);\n\n return fragColor;\n}\n",modules:[t,s,a,n,w]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:R},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:L}})}updateState(e){const{changeFlags:t,props:n}=e;super.updateState(e),t.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll()),t.dataChanged&&function(e){const{header:t,attributes:n}=e;if(t&&n&&(e.length=t.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0)){const{size:e,value:t}=n.COLOR_0;n.instanceColors={size:e,type:"unorm8",value:t}}}(n.data)}draw({}){const{pointSize:e,sizeUnits:t}=this.props,n=this.state.model;n.shaderInputs.setProps({pointCloud:{sizeUnits:i[t],radiusPixels:e}}),"webgpu"===this.context.device.type&&(n.instanceCount=this.props.data.length),n.draw(this.context.renderPass)}_getModel(){const e="webgpu"===this.context.device.type?{depthWriteEnabled:!0,depthCompare:"less-equal"}:void 0,t=[];for(let e=0;e<3;e++){const n=e/3*Math.PI*2;t.push(2*Math.cos(n),2*Math.sin(n),0)}return new o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new r({topology:"triangle-list",attributes:{positions:new Float32Array(t)}}),parameters:e,isInstanced:!0})}}T.layerName="PointCloudLayer",T.defaultProps=E;class z extends r{constructor(e){const{indices:t,attributes:n}=function(e){const{radius:t,height:n=1,nradial:i=10}=e;let{vertices:o}=e;o&&(l.assert(o.length>=i),o=o.flatMap((e=>[e[0],e[1]])),c(o,g.COUNTER_CLOCKWISE));const s=n>0,a=i+1,r=s?3*a+1:i,d=2*Math.PI/i,u=new Uint16Array(s?3*i*2:0),f=new Float32Array(3*r),p=new Float32Array(3*r);let h=0;if(s){for(let e=0;e<a;e++){const s=e*d,a=e%i,r=Math.sin(s),l=Math.cos(s);for(let e=0;e<2;e++)f[h+0]=o?o[2*a]:l*t,f[h+1]=o?o[2*a+1]:r*t,f[h+2]=(.5-e)*n,p[h+0]=o?o[2*a]:l,p[h+1]=o?o[2*a+1]:r,h+=3}f[h+0]=f[h-3],f[h+1]=f[h-2],f[h+2]=f[h-1],h+=3}for(let e=s?0:1;e<a;e++){const s=Math.floor(e/2)*Math.sign(.5-e%2),a=s*d,r=(s+i)%i,l=Math.sin(a),c=Math.cos(a);f[h+0]=o?o[2*r]:c*t,f[h+1]=o?o[2*r+1]:l*t,f[h+2]=n/2,p[h+2]=1,h+=3}if(s){let e=0;for(let t=0;t<i;t++)u[e++]=2*t+0,u[e++]=2*t+2,u[e++]=2*t+0,u[e++]=2*t+1,u[e++]=2*t+1,u[e++]=2*t+3}return{indices:u,attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:p}}}}(e);super({...e,indices:t,attributes:n})}}const D="uniform columnUniforms {\n float radius;\n float angle;\n vec2 offset;\n bool extruded;\n bool stroked;\n bool isStroke;\n float coverage;\n float elevationScale;\n float edgeDistance;\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n highp int radiusUnits;\n highp int widthUnits;\n} column;\n",M={name:"column",vs:D,fs:D,uniformTypes:{radius:"f32",angle:"f32",offset:"vec2<f32>",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},b=[0,0,0,255],I={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:e=>e.position},getFillColor:{type:"accessor",value:b},getLineColor:{type:"accessor",value:b},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class O extends e{getShaders(){const e={},{flatShading:i}=this.props;return i&&(e.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME column-layer-vertex-shader\nin vec3 positions;\nin vec3 normals;\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\nin vec3 instancePickingColors;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec3 cameraPosition;\nout vec4 position_commonspace;\n#endif\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\nvec4 color = column.isStroke ? instanceLineColors : instanceFillColors;\nmat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle));\nfloat elevation = 0.0;\nfloat strokeOffsetRatio = 1.0;\nif (column.extruded) {\nelevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale;\n} else if (column.stroked) {\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits),\ncolumn.widthMinPixels, column.widthMaxPixels) / 2.0;\nfloat halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius);\nif (column.isStroke) {\nstrokeOffsetRatio -= sign(positions.z) * halfOffset;\n} else {\nstrokeOffsetRatio -= halfOffset;\n}\n}\nfloat shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\nfloat dotRadius = column.radius * column.coverage * shouldRender;\ngeometry.pickingColor = instancePickingColors;\nvec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\nvec3 centroidPosition64Low = instancePositions64Low;\nvec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius;\nif (column.radiusUnits == UNIT_METERS) {\noffset = project_size(offset);\n} else if (column.radiusUnits == UNIT_PIXELS) {\noffset = project_pixel_size(offset);\n}\nvec3 pos = vec3(offset, 0.);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\ngeometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nif (column.extruded && !column.isStroke) {\n#ifdef FLAT_SHADING\ncameraPosition = project.cameraPosition;\nposition_commonspace = geometry.position;\nvColor = vec4(color.rgb, color.a * layer.opacity);\n#else\nvec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);\nvColor = vec4(lightColor, color.a * layer.opacity);\n#endif\n} else {\nvColor = vec4(color.rgb, color.a * layer.opacity);\n}\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\nprecision highp float;\nout vec4 fragColor;\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n#endif\nvoid main(void) {\nfragColor = vColor;\ngeometry.uv = vec2(0.);\n#ifdef FLAT_SHADING\nif (column.extruded && !column.isStroke && !bool(picking.isActive)) {\nvec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\nfragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n}\n#endif\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:e,modules:[t,i?d:a,n,M]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:b},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:b},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){super.updateState(e);const{props:t,oldProps:n,changeFlags:i}=e,o=i.extensionsChanged||t.flatShading!==n.flatShading;o&&(this.state.models?.forEach((e=>e.destroy())),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const s=this.getNumInstances();this.state.fillModel.setInstanceCount(s),this.state.wireframeModel.setInstanceCount(s),(o||t.diskResolution!==n.diskResolution||t.vertices!==n.vertices||(t.extruded||t.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(t)}getGeometry(e,t,n){const i=new z({radius:1,height:n?2:0,vertices:t,nradial:e});let o=0;if(t)for(let n=0;n<e;n++){const i=t[n];o+=Math.sqrt(i[0]*i[0]+i[1]*i[1])/e}else o=1;return this.setState({edgeDistance:Math.cos(Math.PI/e)*o}),i}_getModels(){const e=this.getShaders(),t=this.getAttributeManager().getBufferLayouts(),n=new o(this.context.device,{...e,id:`${this.props.id}-fill`,bufferLayout:t,isInstanced:!0}),i=new o(this.context.device,{...e,id:`${this.props.id}-wireframe`,bufferLayout:t,isInstanced:!0});return{fillModel:n,wireframeModel:i,models:[i,n]}}_updateGeometry({diskResolution:e,vertices:t,extruded:n,stroked:i}){const o=this.getGeometry(e,t,n||i);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3});const s=this.state.fillModel,a=this.state.wireframeModel;s.setGeometry(o),s.setTopology("triangle-strip"),s.setIndexBuffer(null),a.setGeometry(o),a.setTopology("line-list")}draw({}){const{lineWidthUnits:e,lineWidthScale:t,lineWidthMinPixels:n,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:a,extruded:r,filled:l,stroked:c,wireframe:g,offset:d,coverage:u,radius:f,angle:p}=this.props,h=this.state.fillModel,m=this.state.wireframeModel,{fillVertexCount:v,edgeDistance:x}=this.state,y={radius:f,angle:p/180*Math.PI,offset:d,extruded:r,stroked:c,coverage:u,elevationScale:a,edgeDistance:x,radiusUnits:i[s],widthUnits:i[e],widthScale:t,widthMinPixels:n,widthMaxPixels:o};r&&g&&(m.shaderInputs.setProps({column:{...y,isStroke:!0}}),m.draw(this.context.renderPass)),l&&(h.setVertexCount(v),h.shaderInputs.setProps({column:{...y,isStroke:!1}}),h.draw(this.context.renderPass)),!r&&c&&(h.setVertexCount(2*v/3),h.shaderInputs.setProps({column:{...y,isStroke:!0}}),h.draw(this.context.renderPass))}}O.layerName="ColumnLayer",O.defaultProps=I;const A=[0,0,0,255],F={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:e=>e.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:A},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class k extends u{initializeState(){this.state={paths:[],pathsDiff:null},this.props.getLineDashArray&&l.removed("getLineDashArray","PathStyleExtension")()}updateState({changeFlags:e}){const t=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(t&&Array.isArray(e.dataChanged)){const t=this.state.paths.slice(),n=e.dataChanged.map((e=>f({data:t,getIndex:e=>e.__source.index,dataRange:e,replace:this._getPaths(e)})));this.setState({paths:t,pathsDiff:n})}else t&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(e={}){const{data:t,getPolygon:n,positionFormat:i,_normalize:o}=this.props,s=[],a="XY"===i?2:3,{startRow:r,endRow:l}=e,{iterable:c,objectInfo:g}=p(t,r,l);for(const e of c){g.index++;let t=n(e,g);o&&(t=h(t,a));const{holeIndices:i}=t,r=t.positions||t;if(i)for(let t=0;t<=i.length;t++){const n=r.slice(i[t-1]||0,i[t]||r.length);s.push(this.getSubLayerRow({path:n},e,g.index))}else s.push(this.getSubLayerRow({path:r},e,g.index))}return s}renderLayers(){const{data:e,_dataDiff:t,stroked:n,filled:i,extruded:o,wireframe:s,_normalize:a,_windingOrder:r,elevationScale:l,transitions:c,positionFormat:g}=this.props,{lineWidthUnits:d,lineWidthScale:u,lineWidthMinPixels:f,lineWidthMaxPixels:p,lineJointRounded:h,lineMiterLimit:x,lineDashJustified:y}=this.props,{getFillColor:P,getLineColor:_,getLineWidth:C,getLineDashArray:S,getElevation:w,getPolygon:L,updateTriggers:R,material:E}=this.props,{paths:T,pathsDiff:z}=this.state,D=this.getSubLayerClass("fill",m),M=this.getSubLayerClass("stroke",v),b=this.shouldRenderSubLayer("fill",T)&&new D({_dataDiff:t,extruded:o,elevationScale:l,filled:i,wireframe:s,_normalize:a,_windingOrder:r,getElevation:w,getFillColor:P,getLineColor:o&&s?_:A,material:E,transitions:c},this.getSubLayerProps({id:"fill",updateTriggers:R&&{getPolygon:R.getPolygon,getElevation:R.getElevation,getFillColor:R.getFillColor,lineColors:o&&s,getLineColor:R.getLineColor}}),{data:e,positionFormat:g,getPolygon:L});return[!o&&b,!o&&n&&this.shouldRenderSubLayer("stroke",T)&&new M({_dataDiff:z&&(()=>z),widthUnits:d,widthScale:u,widthMinPixels:f,widthMaxPixels:p,jointRounded:h,miterLimit:x,dashJustified:y,_pathType:"loop",transitions:c&&{getWidth:c.getLineWidth,getColor:c.getLineColor,getPath:c.getPolygon},getColor:this.getSubLayerAccessor(_),getWidth:this.getSubLayerAccessor(C),getDashArray:this.getSubLayerAccessor(S)},this.getSubLayerProps({id:"stroke",updateTriggers:R&&{getWidth:R.getLineWidth,getColor:R.getLineColor,getDashArray:R.getLineDashArray}}),{data:T,positionFormat:g,getPath:e=>e.path}),o&&b]}}k.layerName="PolygonLayer",k.defaultProps=F;export{C as A,O as C,T as P,k as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"ol/Map";import t from"ol/View";import r from"ol/layer/Vector";import o from"ol/layer/Group";import s from"ol/layer/Tile";import n from"ol/layer/Image";import a from"ol/source/Vector";import i from"ol/source/TileWMS";import c from"ol/source/OSM";import l from"ol/source/XYZ";import u from"ol/source/Google";import f from"ol/source/TileArcGISRest";import w from"ol/Image";import y from"ol/source/Image";import h from"ol/format/GeoJSON";import p from"ol/format/GML2";import m from"ol/format/GML3";import d from"ol/format/GML32";import g from"ol/format/WKT";import b from"ol/control/Control";import S from"ol/style/Style";import L from"ol/style/Fill";import j from"ol/style/Stroke";import G from"ol/style/Circle";import I from"ol/style/Icon";import v from"ol/style/Text";import{bbox as E}from"ol/loadingstrategy";import{get as k,fromLonLat as F}from"ol/proj";import{D as $}from"./p-B-bAcABs.js";import{w as P,e as T,l as x}from"./p-QJHuuz0g.js";import{O as C}from"./p-2-mR3oVa.js";import W from"./p-RpJarvr_.js";import M from"ol/source/GeoTIFF";import{g as O}from"./p-CXfA_q8m.js";import{register as R}from"ol/proj/proj4";import A from"ol/layer/WebGLTile";import"./p-BoNyIrdq.js";import"./p-CrV_misM.js";import"./p-DVBtCUtQ.js";import"./p-E-ZsRS8r.js";async function N(e){return class extends M{geoKeys_=null;constructor(){super(e)}async getGeoKeys(){if(null!==this.geoKeys_)return this.geoKeys_;await this.getView();const e=this.sourceImagery_;return e&&e.length>0&&this.determineGeoKeys(e),this.geoKeys_}determineGeoKeys(e){if(!e||0===e.length)return;const t=e[0];for(let e=t.length-1;e>=0;--e){const o="function"==typeof(r=t[e]).getGeoKeys?r.getGeoKeys()||null:r.geoKeys||null;if(o){this.geoKeys_=o;break}}var r}async getProjectionParameters(){const e=await this.getGeoKeys();return e?O.toProj4(e):null}async getProj4String(){const e=await this.getProjectionParameters();return e&&e.proj4||null}async registerProjectionIfNeeded(){try{const e=await this.getProj4String(),t=this.getProjection()?.getCode();return k(t)||(null===e?(P(`Can not get proj string for code: ${t}`),null):(W.defs(t,e),R(W),k(t)))}catch(e){return T("Fehler bei der Registrierung der Projektion:",e),null}}}}class z{map;layers=[];baseLayers=[];googleLogoAdded=!1;projection="EPSG:3857";layerErrorCallbacks=new globalThis.Map;layerErrorCleanups=new globalThis.Map;async init(r){await async function(e){if(!e)return;const t="ol-css-sheet";if(e.querySelector(`style[data-id="${t}"]`))return;const r=`https://cdn.jsdelivr.net/npm/ol@${C}/ol.css`,o=await(await fetch(r)).text();if("adoptedStyleSheets"in Document.prototype){const t=new CSSStyleSheet;await t.replace(o),e.adoptedStyleSheets=[...e.adoptedStyleSheets??[],t]}else{const r=document.createElement("style");r.setAttribute("data-id",t),r.textContent=o,e.appendChild(r)}}(r.shadowRoot),Object.assign(r.target.style,{width:"100%",height:"100%",position:"relative",background:"#fff"}),this.map=new e({target:r.target,layers:[],view:new t({projection:this.projection,center:F(r?.mapInitOptions?.center??[0,0]),zoom:r?.mapInitOptions?.zoom??2})}),new ResizeObserver((()=>this.map?.updateSize())).observe(r.target)}async destroy(){this.map?.setTarget(void 0),this.map=void 0}async updateLayer(e,t){const r=await this._getLayerById(e);switch(t.type){case"geojson":await this.updateGeoJSONLayer(r,t.data);break;case"osm":await this.updateOSMLayer(r,t.data);break;case"wms":await this.updateWMSLayer(r,t.data);break;case"wfs":await this.updateWFSLayer(r,t.data);break;case"wcs":await this.updateWCSLayer(r,t.data);break;case"arcgis":await this.updateArcGISLayer(r,t.data);break;case"wkt":await this.updateWKTLayer(r,t.data);break;case"geotiff":await this.updateGeoTIFFLayer(r,t.data)}}async ensureGroup(e,t,r){await this._ensureGroup(e,t)}async _ensureGroup(e,t){if(!this.map)return null;let r=this.layers.find((t=>t.get?.("groupId")===e));return r||(r=new o({layers:[],properties:{groupId:e,visible:void 0===typeof t||t}}),this.map.addLayer(r),this.layers.push(r)),r}async setBaseLayer(e,t){if(null===t)return void x("ol - setBaseLayer - layerElementId is null.");const r=this.layers.find((t=>t.get?.("groupId")===e)),o=this.baseLayers.find((e=>e.get("layerElementId")===t));void 0!==o?(r.getLayers().clear(),r.getLayers().push(o)):x("ol - setBaseLayer - layer not found. layerElementId: "+t)}async addBaseLayer(e,t,r){if(null==r)return x("ol - addBaseLayer - layerElementId not set."),null;null==t&&x("ol - addBaseLayer - basemapid not set.");const o=await this._ensureGroup(e.groupId,e.groupVisible);if(null==o)return null;o.set("basemap",!0,!1);const s=await this.createLayer(e);if(null==s)return null;s.set("group",o),this.baseLayers.push(s);let n=null;if(s){n=crypto.randomUUID(),s.set("id",n,!1),s.set("layerElementId",r,!1);const a=e;void 0!==a.opacity&&s.setOpacity(a.opacity),void 0!==a.zIndex&&s.setZIndex(a.zIndex),a.visible?s.setVisible(!0):!1===a.visible&&s.setVisible(!1),t===r&&(o.getLayers().clear(),o.getLayers().push(s))}return n}async addLayerToGroup(e){const t=await this._ensureGroup(e.groupId,e.groupVisible);if(null==t)return null;const r=await this.createLayer(e);if(null===r)return null;r.set("group",t),t.getLayers().push(r);const o=crypto.randomUUID();r.set("id",o,!1);const s=e;return void 0!==s.opacity&&r.setOpacity(s.opacity),void 0!==s.zIndex&&r.setZIndex(s.zIndex),s.visible?r.setVisible(!0):!1===s.visible&&r.setVisible(!1),o}async createLayer(e){switch(e.type){case"geojson":return this.createGeoJSONLayer(e);case"xyz":return this.createXYZLayer(e);case"google":return this.createGoogleLayer(e);case"osm":return this.createOSMLayer(e);case"wms":return this.createWMSLayer(e);case"wfs":return this.createWFSLayer(e);case"wcs":return this.createWCSLayer(e);case"arcgis":return this.createArcGISLayer(e);case"wkt":return this.createWKTLayer(e);case"geotiff":return this.createGeoTIFFLayer(e);default:throw new Error(`Unsupported layer type: ${e.type}`)}}async updateWMSLayer(e,t){e.setSource(new i({url:t.url,params:{LAYERS:t.layers,TILED:!0,...t.extraParams??{}}}))}async updateOSMLayer(e,t){let r="https://tile.openstreetmap.org/{z}/{x}/{y}.png";t.url&&(r=t.url+"/{z}/{x}/{y}.png"),e.setSource(new c({url:r}))}async updateGeoJSONLayer(e,t){let r=null;const o={featureProjection:this.projection};if(t.geojson){const e=JSON.parse(t.geojson);r=new a({features:new h(o).readFeatures(e)})}else r=new a({url:t.url,format:new h(o)});let s;e.setSource(r),t.geostylerStyle?s=await this.createGeostylerStyleFunction(t.geostylerStyle):t.style&&(s=await this.createEnhancedStyleFunction(t.style)),s&&e.setStyle(s)}async updateWFSLayer(e,t){const r=this.mergeLayerConfig(e,"wfsConfig",t),o=await this.createWFSSpource(r);let s;e.setSource(o),r.geostylerStyle?s=await this.createGeostylerStyleFunction(r.geostylerStyle):r.style&&(s=await this.createEnhancedStyleFunction(r.style)),s&&e.setStyle(s)}async updateWCSLayer(e,t){const r=this.mergeLayerConfig(e,"wcsConfig",t),o=await this.createWcsSource(r);e.setSource(o)}async updateArcGISLayer(e,t){const r=e,o=r.getSource(),s={...o?.getParams?.()??{},...t?.params??{}};t?.token&&(s.token=t.token);const n={url:t?.url??o?.getUrls?.()?.[0],params:s,...t?.options??{}},a=new f(n);r.setSource(a)}async createEnhancedStyleFunction(e){function t(e,t){if(e.startsWith("rgba")){const r=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r){const[,e,o,s]=r;return`rgba(${e}, ${o}, ${s}, ${t})`}}else if(e.startsWith("rgb")){const r=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(r){const[,e,o,s]=r;return`rgba(${e}, ${o}, ${s}, ${t})`}}else if(e.startsWith("#")){const r=e.slice(1);return`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`}return e}return r=>{const o=[],s=r.getGeometry().getType(),n=new L({color:t(e.fillColor??"rgba(0,100,255,0.3)",e.fillOpacity??.3)}),a=e.strokeWidth??2,i=new j({color:t(e.strokeColor??"rgba(0,100,255,1)",e.strokeOpacity??1),width:a,lineDash:e.strokeDashArray});if(o.push(new S("Point"===s?e.iconUrl?{image:new I({src:e.iconUrl,size:e.iconSize||[32,32],anchor:e.iconAnchor||[.5,1]})}:{image:new G({radius:e.pointRadius??6,fill:new L({color:t(e.pointColor??"rgba(0,100,255,1)",e.pointOpacity??1)}),stroke:i})}:{fill:s.includes("Polygon")?n:void 0,stroke:i})),e.textProperty&&r.get(e.textProperty)){const t=e.textColor??"#000000",s=e.textSize??12,n=e.textHaloColor,a=e.textHaloWidth??2,i=e.textOffset||[0,0];o.push(new S({text:new v({text:String(r.get(e.textProperty)),font:`${s}px Arial`,fill:new L({color:t}),stroke:n?new j({color:n,width:a}):void 0,offsetX:i[0],offsetY:i[1]})}))}return o}}async createGeoJSONLayer(e){let t=null;const o={featureProjection:this.projection};if(e.geojson){const r=JSON.parse(e.geojson);t=new a({features:new h(o).readFeatures(r)})}else t=new a({url:e.url,format:new h(o)});let s;if(e.geostylerStyle)s=await this.createGeostylerStyleFunction(e.geostylerStyle);else{const t=e.style?{...$,...e.style}:$;s=await this.createEnhancedStyleFunction(t)}return new r({source:t,style:s})}async createWFSSpource(e){const t=(e.outputFormat??"application/json").toLowerCase();let r=new h;switch(t){case"gml2":r=new p;break;case"gml3":r=new m;break;case"gml32":r=new d}const o=this.getWFSGetFeatureUrl(e);return new a({format:r,url:o,strategy:E})}async createWFSLayer(e){const t=await this.createWFSSpource(e);let o;if(e.geostylerStyle)o=await this.createGeostylerStyleFunction(e.geostylerStyle);else{const t=e.style?{...$,...e.style}:$;o=await this.createEnhancedStyleFunction(t)}const s=new r({source:t,style:o});return s.set("wfsConfig",e,!1),s}async createGeostylerStyleFunction(e){const t=(e,t)=>null==e||"object"==typeof e&&e.name?t:e;return r=>{const o=[],s=r.getGeometry().getType();if(e.rules)for(const n of e.rules)if(n.symbolizers)for(const e of n.symbolizers)switch(e.kind){case"Fill":if(s.includes("Polygon")){const r=t(e.color,"rgba(0,100,255,0.3)"),s=t(e.outlineColor),n=t(e.outlineWidth,1);o.push(new S({fill:new L({color:r}),stroke:s?new j({color:s,width:n}):void 0}))}break;case"Line":{const r=t(e.color,"rgba(0,100,255,1)"),s=t(e.width,1),n=e.dasharray&&Array.isArray(e.dasharray)?e.dasharray.map((e=>t(e,0))):void 0;o.push(new S({stroke:new j({color:r,width:s,lineDash:n})}))}break;case"Mark":if("Point"===s){const r=t(e.color,"rgba(0,100,255,1)"),s=t(e.radius,6),n=t(e.strokeColor),a=t(e.strokeWidth,1);o.push(new S({image:new G({radius:s,fill:new L({color:r}),stroke:n?new j({color:n,width:a}):void 0})}))}break;case"Icon":if("Point"===s){const r=t(e.image),s=t(e.size,32),n=t(e.opacity,1);r&&"string"==typeof r&&o.push(new S({image:new I({src:r,size:[s,s],opacity:n})}))}break;case"Text":{const s=e,n=t(s.label);if(n&&r.get(n)){const e=t(s.color,"#000000"),a=t(s.size,12),i=t(s.font?.[0],"Arial"),c=t(s.haloColor),l=t(s.haloWidth,1),u=s.offset,f=u&&Array.isArray(u)?t(u[0],0):0,w=u&&Array.isArray(u)?t(u[1],0):0;o.push(new S({text:new v({text:String(r.get(n)),font:`${a}px ${i}`,fill:new L({color:e}),stroke:c?new j({color:c,width:l}):void 0,offsetX:f,offsetY:w})}))}}}return o.length>0?o:void 0}}async createXYZLayer(e){return new s({source:new l({url:e.url,attributions:e.attributions,maxZoom:e.maxZoom??19,...e.options??{}})})}async createGoogleLayer(e){if(!e.apiKey)throw new Error("Google-Layer benötigt 'apiKey' (Google Maps Platform).");const t=new u({key:e.apiKey,mapType:e.mapType??"roadmap",scale:e.scale??"scaleFactor2x",highDpi:e.highDpi??!0,language:e.language,region:e.region,imageFormat:e.imageFormat,styles:e.styles,layerTypes:e.layerTypes});t.on("change",(()=>{if("error"===t.getState()){const e=t.getError();T("Google source error",e),this.map.getTargetElement()?.dispatchEvent(new CustomEvent("google-source-error",{detail:{message:e??"Google source error"},bubbles:!0,composed:!0}))}}));const r=new s({source:t});if(!this.googleLogoAdded){class e extends b{constructor(){const e=document.createElement("img");e.style.pointerEvents="none",e.style.position="absolute",e.style.bottom="5px",e.style.left="5px",e.style.height="18px",e.alt="Google",e.src="https://developers.google.com/static/maps/documentation/images/google_on_white.png",super({element:e})}}this.map.addControl(new e),this.googleLogoAdded=!0}return r}async createOSMLayer(e){let t="https://tile.openstreetmap.org/{z}/{x}/{y}.png";return e.url&&(t=e.url+"/{z}/{x}/{y}.png"),new s({source:new c({url:t})})}async createWMSLayer(e){return new s({source:new i({url:e.url,params:{LAYERS:e.layers,TILED:!0,...e.extraParams??{}}})})}onLayerError(e,t){this.layerErrorCallbacks.set(e,t),this._getLayerById(e).then((t=>{t&&this.attachSourceErrorListeners(e,t)}))}offLayerError(e){this.layerErrorCleanups.get(e)?.(),this.layerErrorCleanups.delete(e),this.layerErrorCallbacks.delete(e)}attachSourceErrorListeners(e,t){this.layerErrorCleanups.get(e)?.();const r=this.layerErrorCallbacks.get(e);if(!r)return;const o=t.getSource?.();if(!o)return;const s=[];if("getTile"in o||o instanceof i||o instanceof c||o instanceof l||o instanceof u||o instanceof f){const e=()=>{r({type:"network",message:"Tile load error"})};o.on("tileloaderror",e),s.push((()=>o.un("tileloaderror",e)))}if(o instanceof a){const e=()=>{r({type:"network",message:"Feature load error"})};o.on("featuresloaderror",e),s.push((()=>o.un("featuresloaderror",e)))}if(o instanceof y){const e=()=>{r({type:"network",message:"Image load error"})};o.on("imageloaderror",e),s.push((()=>o.un("imageloaderror",e)))}const n=()=>{this.attachSourceErrorListeners(e,t)};t.on("change:source",n),s.push((()=>t.un("change:source",n))),this.layerErrorCleanups.set(e,(()=>s.forEach((e=>e()))))}async setView(e,t){this.map&&this.map.getView().animate({center:F(e),zoom:t,duration:0})}async _forEachLayer(e,t){if(e instanceof o){const r=e.getLayers().getArray();for(const e of r)if(await this._forEachLayer(e,t))return!0}else if(t(e))return!0;return!1}async _getLayerById(e){if(!this.map)return null;let t=null;return await this._forEachLayer(this.map.getLayerGroup(),(r=>{if(r.get("id")===e)return t=r,!0})),t||(t=this.baseLayers.find((t=>t.get("id")===e)),void 0===t?null:t)}async _getLayerGroupById(e){if(!this.map)return null;const t=this.layers.find((t=>t.get?.("groupId")===e));return void 0!==t?t:null}async removeLayer(e){if(!e)return;this.offLayerError(e);const t=await this._getLayerById(e);if(t){const e=t.get("group");e&&e.getLayers().remove(t)}}async setOpacity(e,t){if(!e)return;const r=await this._getLayerById(e);r&&r.setOpacity(t)}async setZIndex(e,t){if(!e)return;const r=await this._getLayerById(e);r&&r.setZIndex(t)}async setVisible(e,t){const r=await this._getLayerById(e);r&&r.setVisible(t)}async setGroupVisible(e,t){const r=await this._getLayerGroupById(e);r&&r.setVisible(t)}async updateWKTLayer(e,t){const r=new g;let o=null;const s=this.map?.getView()?.getProjection();if(t.wkt){const e=r.readFeature(t.wkt,{dataProjection:"EPSG:4326",featureProjection:s});o=new a({features:[e]})}else if(t.url){const e=await fetch(t.url);if(!e.ok)throw new Error(`Failed to fetch WKT: ${e.status}`);const n=await e.text(),i=r.readFeature(n,{dataProjection:"EPSG:4326",featureProjection:s});o=new a({features:[i]})}let n;o&&e.setSource(o),t.geostylerStyle?n=await this.createGeostylerStyleFunction(t.geostylerStyle):t.style&&(n=await this.createEnhancedStyleFunction(t.style)),n&&e.setStyle(n)}async createWKTLayer(e){const t=new g;let o=null;const s=this.map?.getView()?.getProjection();if(e.wkt)try{const r=t.readFeature(e.wkt,{dataProjection:"EPSG:4326",featureProjection:s});o=new a({features:[r]})}catch(e){T("Failed to parse WKT:",e),o=new a({features:[]})}else if(e.url)try{const r=await fetch(e.url);if(!r.ok)throw new Error(`Failed to fetch WKT: ${r.status}`);const n=await r.text(),i=t.readFeature(n,{dataProjection:"EPSG:4326",featureProjection:s});o=new a({features:[i]})}catch(e){T("Failed to load WKT from URL:",e),o=new a({features:[]})}else o=new a({features:[]});let n;if(e.geostylerStyle)n=await this.createGeostylerStyleFunction(e.geostylerStyle);else{const t=e.style?{...$,...e.style}:$;n=await this.createEnhancedStyleFunction(t)}return new r({source:o,style:n,opacity:e.opacity??1,visible:e.visible??!0,zIndex:e.zIndex??1e3})}async createGeoTIFFLayer(e){if(!e.url)throw new Error("GeoTIFF layer requires a URL");const t={url:e.url};null===e.nodata||isNaN(e.nodata)||(t.nodata=e.nodata);const r=new(await N({sources:[t],wrapX:!1}));return await r.registerProjectionIfNeeded(),new A({source:r,opacity:e.opacity??1,visible:e.visible??!0,zIndex:e.zIndex??100})}async createWCSLayer(e){const t=await this.createWcsSource(e),r=new n({source:t,visible:e.visible??!0,opacity:e.opacity??1});return r.set("wcsConfig",e,!1),r}getWFSGetFeatureUrl(e){return t=>{const r={service:"WFS",request:"GetFeature",version:e.version??"1.1.0",typeName:e.typeName,outputFormat:e.outputFormat??"application/json",bbox:t.join(","),srsName:e.srsName??this.projection,...e.params??{}};return this.appendParams(e.url,r)}}getWCSGetCoverageUrl(e,t){return r=>{const o=e.version??"2.0.1",s=e.format??"image/tiff",n=e.projection??this.projection,a={SERVICE:"WCS",REQUEST:"GetCoverage",VERSION:o,FORMAT:s};if(o.startsWith("2.0")){a.coverageId=e.coverageName;const[t,o,n,i]=r;a.subset=`X(${t},${n})`,a.subset2=`Y(${o},${i})`,(s.includes("tiff")||s.includes("geotiff"))&&(a["geotiff:compression"]="LZW")}else{a.COVERAGE=e.coverageName,a.BBOX=r.join(","),a.CRS=n;const o=Math.round((r[2]-r[0])/t),s=Math.round((r[3]-r[1])/t);a.WIDTH=o,a.HEIGHT=s}if(e.params&&Object.entries(e.params).forEach((([e,t])=>{"string"!=typeof t&&"number"!=typeof t||(a[e]=t)})),o.startsWith("2.0")){const t=a.subset2;delete a.subset2;const r=new URLSearchParams;Object.entries(a).forEach((([e,t])=>{null!=t&&r.append(e,String(t))})),t&&r.append("subset",String(t));const o=e.url;return`${o}${o.includes("?")?"&":"?"}${r.toString()}`}return this.appendParams(e.url,a)}}mergeLayerConfig(e,t,r){const o={...e.get(t)??{},...r};return e.set(t,o,!1),o}appendParams(e,t){const r=new URLSearchParams;return Object.entries(t).forEach((([e,t])=>{null!=t&&r.set(e,String(t))})),r.toString()?`${e}${e.includes("?")?"&":"?"}${r.toString()}`:e}async createWcsSource(e){const t=e.projection??this.projection,r=this.map?.getView()?.getResolution()??1,o=this.getWCSGetCoverageUrl(e,r);return new class extends y{urlFunction_;constructor(r){super({projection:t,resolutions:e.resolutions}),this.urlFunction_=r}getImageInternal(e,t,r,o){const s=this.urlFunction_(e),n=new w(e,t,r,s);return n.load=()=>{const e=n.getImage();e.src!==s&&(e.crossOrigin="anonymous",e.src=s)},n}}(o)}async createArcGISLayer(e){const t={...e.params??{}};e.token&&(t.token=e.token);const r={url:e.url,params:t,...e.options??{}};return new s({source:new f(r),visible:e.visible??!0})}async updateGeoTIFFLayer(e,t){if(!t.url)throw new Error("GeoTIFF update requires a URL");const r={url:t.url};null==t.nodata||isNaN(t.nodata)||(r.nodata=t.nodata);const o=new(await N({sources:[r],wrapX:!1}));await o.registerProjectionIfNeeded(),e.setSource(o)}getMap(){return this.map}}export{z as OpenLayersProvider}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,L as e,s,w as i}from"./p-2-mR3oVa.js";import*as r from"leaflet";import{e as o,l as a}from"./p-QJHuuz0g.js";import{D as n}from"./p-B-bAcABs.js";import{l as c,G as l,g as h}from"./p-yXLNXXx-.js";import{w as u}from"./p-DR9McdNX.js";import{GmlParser as f}from"./p-DhQAXuA7.js";import"./p-BoNyIrdq.js";import"./p-CrV_misM.js";import"./p-DVBtCUtQ.js";import"./p-E-ZsRS8r.js";const p=256;class y extends r.GridLayer{apiKey;highDpi;sessionRequest;scaleFactor;sessionToken;sessionPromise;sessionRefreshId;previousViewport;currentAttribution;mapInstance;onMoveEnd;constructor(t){super(),this.applyInitialGridOptions(t);const{apiKey:e,mapType:s,language:i,region:r,imageFormat:o,scale:a,highDpi:n,layerTypes:c,overlay:l,styles:h,apiOptions:u}=t;if(!e)throw new Error("Google Map Tiles layer requires an apiKey");this.apiKey=e,this.highDpi=n??(void 0===a||"scaleFactor1x"!==a),this.scaleFactor=this.mapScaleToFactor(a,this.highDpi);const f={mapType:s??"roadmap",language:i??"en-US",region:r??"US"};o&&(f.imageFormat=o),c?.length&&(f.layerTypes=c),u?.length&&(f.apiOptions=u),Array.isArray(h)&&h.length>0&&(f.styles=h),!0===l&&(f.overlay=!0);const p=a??(this.scaleFactor>1?this.factorToScale(this.scaleFactor):void 0);p&&(f.scale=p),this.highDpi&&(f.highDpi=!0),this.sessionRequest=f,this.onMoveEnd=()=>{this.updateAttribution()},this.sessionPromise=this.startSessionFetch()}onAdd(t){return this.mapInstance=t,t.on("moveend",this.onMoveEnd),t.on("zoomend",this.onMoveEnd),this.ensureSession().then((()=>this.updateAttribution())),super.onAdd(t)}onRemove(t){return t.off("moveend",this.onMoveEnd),t.off("zoomend",this.onMoveEnd),this.clearSessionRefresh(),this.removeCurrentAttribution(),this.mapInstance=void 0,super.onRemove(t)}createTile(t,e){const s=document.createElement("img");s.decoding="async",s.alt="",s.crossOrigin="anonymous";const i=this.resolveTileSize();s.width=i.x,s.height=i.y;const r=t=>{const i=t instanceof Error?t.message:"Google tile load error";e(new Error(i),s)};return s.onload=()=>e(null,s),s.onerror=t=>{const e=t instanceof ErrorEvent?t.error??new Error(t.message):new Error("Google tile failed to load");r(e)},this.ensureSession().then((()=>{this.sessionToken?s.src=this.buildTileUrl(t):r(new Error("Google Maps session unavailable"))})).catch((t=>{r(t)})),s}ensureSession(){return this.sessionToken?Promise.resolve():(this.sessionPromise||(this.sessionPromise=this.startSessionFetch()),this.sessionPromise)}startSessionFetch(t=!1){if(this.sessionPromise&&!t)return this.sessionPromise;const e=this.fetchAndApplySession().catch((t=>{const e=t instanceof Error?t:new Error("Failed to create Google Maps session");throw o("Google Map Tiles session error",e),this.sessionToken=void 0,e})).finally((()=>{this.sessionPromise===e&&(this.sessionPromise=void 0)}));return this.sessionPromise=e,e}async fetchAndApplySession(){const t=`https://tile.googleapis.com/v1/createSession?key=${this.apiKey}`,e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionRequest)});if(!e.ok){let t;try{const s=await e.json();t=s?.error?.message}catch{}throw new Error(t??`Google Maps session request failed (${e.status})`)}const s=await e.json();this.sessionToken=s.session,this.applyTileSize(s),this.scheduleSessionRefresh(this.parseExpiry(s.expiry)),this.mapInstance&&(this.updateAttribution(),this.redrawLayer()),a("Google Map Tiles session established")}scheduleSessionRefresh(t){if(!isFinite(t))return;const e=Math.max(t-Date.now()-6e4,1e3);this.clearSessionRefresh(),this.sessionRefreshId=setTimeout((()=>{this.startSessionFetch(!0).then((()=>{this.mapInstance&&(this.updateAttribution(),this.redrawLayer())}))}),e)}clearSessionRefresh(){void 0!==this.sessionRefreshId&&(clearTimeout(this.sessionRefreshId),this.sessionRefreshId=void 0)}async updateAttribution(){if(!this.mapInstance||!this.sessionToken)return;const t=this.mapInstance.getBounds();if(!t?.isValid())return;const e=`zoom=${this.mapInstance.getZoom()}&north=${t.getNorth()}&south=${t.getSouth()}&east=${t.getEast()}&west=${t.getWest()}`;if(this.previousViewport!==e){this.previousViewport=e;try{const t=await fetch(`https://tile.googleapis.com/tile/v1/viewport?session=${this.sessionToken}&key=${this.apiKey}&${e}`);if(!t.ok)throw new Error(`Attribution request failed (${t.status})`);const s=await t.json(),i=s?.copyright;"string"==typeof i&&i.length>0&&this.applyAttribution(i)}catch(t){o("Failed to fetch Google attribution",t)}}}applyAttribution(t){const e=this.mapInstance;e?.attributionControl&&(this.currentAttribution&&this.currentAttribution!==t&&e.attributionControl.removeAttribution(this.currentAttribution),this.currentAttribution&&this.currentAttribution===t||(e.attributionControl.addAttribution(t),this.currentAttribution=t))}removeCurrentAttribution(){const t=this.mapInstance;t?.attributionControl&&this.currentAttribution&&(t.attributionControl.removeAttribution(this.currentAttribution),this.currentAttribution=void 0)}applyTileSize(t){const e=Math.max(1,Math.round(t.tileWidth/this.scaleFactor)),s=Math.max(1,Math.round(t.tileHeight/this.scaleFactor)),i=r.point(e,s);this.setGridOptions({tileSize:i})}parseExpiry(t){const e=parseInt(t,10);return Number.isFinite(e)?1e3*e:Number.NaN}buildTileUrl(t){if(!this.sessionToken)throw new Error("Google Maps session missing");return`https://tile.googleapis.com/v1/2dtiles/${t.z}/${t.x}/${t.y}?session=${this.sessionToken}&key=${this.apiKey}`}mapScaleToFactor(t,e){switch(t){case"scaleFactor4x":return 4;case"scaleFactor2x":return 2;case"scaleFactor1x":return 1;default:return e?2:1}}factorToScale(t){switch(t){case 4:return"scaleFactor4x";case 2:return"scaleFactor2x";case 1:return"scaleFactor1x";default:return}}applyInitialGridOptions(t){const e={},s=["attribution","bounds","className","detectRetina","errorTileUrl","keepBuffer","maxNativeZoom","maxZoom","minNativeZoom","minZoom","noWrap","opacity","pane","reuseTiles","subdomains","tileSize","tms","updateInterval","updateWhenIdle","updateWhenZooming","zIndex","zoomOffset"];for(const i of s){const s=t[i];void 0!==s&&(e[i]=s)}void 0===e.maxZoom&&(e.maxZoom=22),this.setGridOptions(e)}setGridOptions(t){const e=r.Util?.setOptions;if("function"==typeof e)e(this,t);else{const e=this;e.options={...e.options,...t}}}resolveTileSize(){const t=this.options?.tileSize;if(t&&"object"==typeof t){if(Array.isArray(t)&&2===t.length){const[e,s]=t;return r.point(Number(e)||p,Number(s)||p)}if("x"in t&&"y"in t){const e=t;return r.point(Number(e.x)||p,Number(e.y)||p)}}return"number"==typeof t&&Number.isFinite(t)?r.point(t,t):r.point(p,p)}redrawLayer(){this.redraw()}}class d extends r.GridLayer{geotiffOptions;tileProcessor=null;colorStops;loadingPromise;defaultResolution=1;defaultResample="bilinear";constructor(t){super(t),this.geotiffOptions={...t}}onAdd(t){return super.onAdd(t),this.ensureReady().then((()=>this.redraw())),this}createTile(t,e){const s=this.getTileSize(),i=r.DomUtil.create("canvas","leaflet-tile");return i.width=s.x,i.height=s.y,this.ensureReady().then((async()=>{if(this.tileProcessor)try{const r=await this.tileProcessor.getTileData({x:t.x,y:t.y,z:t.z,tileSize:s.x,resolution:this.geotiffOptions.resolution??this.defaultResolution,resampleMethod:this.geotiffOptions.resampleMethod??this.defaultResample,colorStops:this.colorStops});if(!r)return void e(null,i);const o=i.getContext("2d");if(o){const t=o.createImageData(s.x,s.y);t.data.set(r),o.putImageData(t,0,0)}e(null,i)}catch(t){e(t,i)}else e(null,i)})).catch((t=>{e(t,i)})),i}async ensureReady(){return this.loadingPromise||(this.loadingPromise=this.initializeProcessor()),this.loadingPromise}async updateSource(t){Object.assign(this.geotiffOptions,t),this.tileProcessor=null,this.colorStops=void 0,this.loadingPromise=void 0,await this.ensureReady(),this.redraw()}async initializeProcessor(){if(this.tileProcessor)return;const[t,{default:e},s]=await Promise.all([import("./p-Be3r33VF.js").then((function(t){return t.g})),import("./p-RpJarvr_.js"),import("./p-CXfA_q8m.js").then((function(t){return t.m}))]),i=await c(this.geotiffOptions.url,{projection:void 0,forceProjection:!1,nodata:this.geotiffOptions.nodata},{geotiff:t,proj4:e,geokeysToProj4:s}),r=t=>{const e=i.proj4(i.fromProjection,this.geotiffOptions.viewProjection,t);return[Number(e[0]),Number(e[1])]};if(this.tileProcessor=new l({transformViewToSourceMapFn:t=>{const e=i.proj4(this.geotiffOptions.viewProjection,i.fromProjection,t);return[Number(e[0]),Number(e[1])]},transformSourceMapToViewFn:r,sourceBounds:i.sourceBounds,sourceRef:i.sourceRef,resolution:i.resolution,imageWidth:i.width,imageHeight:i.height,fromProjection:i.fromProjection,toProjection:this.geotiffOptions.viewProjection,baseImage:i.baseImage,overviewImages:i.overviewImages??[]}),this.tileProcessor.createGlobalTriangulation(),this.setViewBounds(i.sourceBounds,r),this.geotiffOptions.colorMap){const{stops:t}=h(this.geotiffOptions.colorMap,this.geotiffOptions.valueRange);this.colorStops=t}}setViewBounds(t,e){const[s,i,o,a]=t,n=e([s,i]),c=e([o,i]),l=e([s,a]),h=e([o,a]),u=Math.min(n[0],c[0],l[0],h[0]),f=Math.max(n[0],c[0],l[0],h[0]),p=Math.min(n[1],c[1],l[1],h[1]),y=Math.max(n[1],c[1],l[1],h[1]),d=r.CRS.EPSG3857.unproject(r.point(u,y)),m=r.CRS.EPSG3857.unproject(r.point(f,p));this.options.bounds=r.latLngBounds(d,m)}}const m="v-map - leaflet - wcs - tile - ";class w extends r.GridLayer{wcsOptions;constructor(t){super(t),this.wcsOptions={...t,version:t.version??"2.0.1",format:t.format??"image/tiff",projection:t.projection??"EPSG:4326"}}buildWCSUrl(t){const{url:e,coverageName:s,version:i,format:r,projection:o,params:a}=this.wcsOptions,n=this._tileCoordsToBounds(t),c=n.getSouthWest(),l=n.getNorthEast(),h=c.lng,u=c.lat,f=l.lng,p=l.lat,y={SERVICE:"WCS",REQUEST:"GetCoverage",VERSION:i,FORMAT:r};if(i.startsWith("2.0")){y.coverageId=s;const t=a?{...a}:{},i={...y,...t};(r.includes("tiff")||r.includes("geotiff"))&&(i["geotiff:compression"]="LZW");const o=new URLSearchParams;Object.entries(i).forEach((([t,e])=>{null!=e&&o.set(t,String(e))}));const n=o.toString(),c=`subset=X(${h},${f})`,l=`subset=Y(${u},${p})`;return`${e}${e.includes("?")?"&":"?"}${n}&${c}&${l}`}{y.COVERAGE=s,y.BBOX=`${h},${u},${f},${p}`,y.CRS=o;const t=this.getTileSize();y.WIDTH="number"==typeof t?t:t.x,y.HEIGHT="number"==typeof t?t:t.y;const i=a?{...a}:{},r={...y,...i},n=new URLSearchParams;return Object.entries(r).forEach((([t,e])=>{null!=e&&n.set(t,String(e))})),`${e}${e.includes("?")?"&":"?"}${n.toString()}`}}createTile(t,e){const s=document.createElement("img"),i=this.buildWCSUrl(t);return a(`${m}load: coords=(${t.x},${t.y},${t.z})`),a(`${m}url: ${i}`),s.onload=()=>{e(null,s)},s.onerror=t=>{o(`${m}failed to load tile:`,t),e(t instanceof Error?t:new Error(String(t)),s)},s.crossOrigin="anonymous",s.src=i,s}updateOptions(t){this.wcsOptions={...this.wcsOptions,...t},this.redraw()}}class g{map;layers=[];baseLayers=[];hiddenLayerGroups=[];googleLogoAdded=!1;unsubscribeResize;shadowRoot;injectedStyle;layerErrorCallbacks=new Map;layerErrorCleanups=new Map;async init(o){if(!t())return;this.shadowRoot=o.shadowRoot,this.injectedStyle=function(i,o){if(t()){switch(i){case"cdn":return function(s,i=e,o="jsdelivr"){if(!t())return;const a="unpkg"===o?`https://unpkg.com/leaflet@${i}/dist/leaflet.css`:`https://cdn.jsdelivr.net/npm/leaflet@${i}/dist/leaflet.css`;r.Icon.Default.imagePath="unpkg"===o?`https://unpkg.com/npm/leaflet@${i}/dist/images/`:`https://cdn.jsdelivr.net/npm/leaflet@${i}/dist/images/`;const n=s??document;if(n.querySelector?.(`link[rel="stylesheet"][href="${a}"]`)||document.head.querySelector(`link[rel="stylesheet"][href="${a}"]`))return null;const c=document.createElement("link");return c.rel="stylesheet",c.href=a,(s??document.head).appendChild(c),c}(o);case"inline-min":return function(e){if(!t())return;const i="\n :host { display:block; }\n #map { width:100%; height:100%; display:block; }\n ";if(s()){const t=new CSSStyleSheet;t.replaceSync(i);const s=e??document;return s.adoptedStyleSheets=[...s.adoptedStyleSheets??[],t],null}{const t=document.createElement("style");return t.textContent=i,(e??document.head).appendChild(t),t}}(o)}return null}}(o.cssMode,this.shadowRoot);const[a,n]=o?.mapInitOptions?.center??[0,0];this.map=r.map(o.target,{zoomControl:!0,attributionControl:!0}).setView([n,a],o?.mapInitOptions?.zoom??2),this.unsubscribeResize=i(o.target,(()=>{this.map?.invalidateSize()}),{attributes:!0,attributeFilter:["style","class"]})}async updateLayer(t,e){const s=await this._getLayerById(t);switch(e.type){case"geojson":await this.updateGeoJSONLayer(s,e.data);break;case"osm":await this.updateOSMLayer(s,e.data);break;case"arcgis":await this.updateArcGISLayer(s,e.data);break;case"wkt":await this.updateWKTLayer(s,e.data);break;case"geotiff":await this.updateGeoTIFFLayer(s,e.data);break;case"wcs":await this.updateWCSLayer(s,e.data);break;case"wfs":s instanceof r.GeoJSON&&await this.updateWFSLayer(s,e.data)}}async addLayerToGroup(t){const e=await this._ensureGroup(t.groupId,t.groupVisible),s=await this.createLayer(t);if(null==s)return null;e.addLayer(s);const i=this.getLayerId(s);return s.vmapVisible=!0,s.vmapOpacity=1,void 0!==t.opacity&&this.setOpacityByLayer(s,t.opacity),void 0!==t.zIndex&&s.setZIndex?.(t.zIndex),t.visible?this.setVisibleByLayer(s,!0):!1===t.visible&&this.setVisibleByLayer(s,!1),i}async addBaseLayer(t,e,s){if(null==s)return a("leaflet - addBaseLayer - layerElementId not set."),null;null==e&&a("leaflet - addBaseLayer - basemapid not set.");const i=await this._ensureGroup(t.groupId,t.groupVisible);i.basemap=!0;const r=await this.createLayer(t);if(this.baseLayers.push(r),null==r)return null;r.layerElementId=s;const o=this.getLayerId(r);if(r.vmapVisible=!0,r.vmapOpacity=1,void 0!==t.opacity&&this.setOpacityByLayer(r,t.opacity),void 0!==t.zIndex&&r.setZIndex?.(t.zIndex),t.visible?this.setVisibleByLayer(r,!0):!1===t.visible&&this.setVisibleByLayer(r,!1),e===s){const t=i.getLayers()[0];t&&(this.map.removeLayer(t),i.clearLayers()),i.addLayer(r),i.visible&&r.addTo(this.map)}return o}async setBaseLayer(t,e){if(null===e)return void a("leaflet - setBaseLayer - layerElementId is null.");const s=this.layers.find((e=>e._groupId===t)),i=this.baseLayers.find((t=>t.layerElementId===e));if(void 0===i)return void a("leaflet - setBaseLayer - layer not found. layerElementId: "+e);if(!s)return;const r=s.getLayers()[0];r&&(this.map.removeLayer(r),s.clearLayers()),s.addLayer(i)}getLayerId(t){return String(r.Util.stamp(t))}normalizeAttribution(t){return Array.isArray(t)?t.join(", "):t}async _getLayerById(t){let e=null;return this.map?.eachLayer((s=>{this.getLayerId(s)===t&&(e=s)})),e||(e=this.baseLayers.find((e=>this.getLayerId(e)===t))??null,void 0===e?null:e)}async createLayer(t){switch(t.type){case"geojson":return this.createGeoJSONLayer(t);case"xyz":return this.createXYZLayer(t);case"osm":return this.createOSMLayer(t);case"wms":return this.createWMSLayer(t);case"wcs":return this.createWCSLayer(t);case"wfs":return this.createWFSLayer(t);case"arcgis":return this.createArcGISLayer(t);case"google":return this.createGoogleLayer(t);case"wkt":return this.createWKTLayer(t);case"geotiff":return this.createGeoTIFFLayer(t);default:throw new Error(`Unsupported layer type: ${t.type}`)}}async updateGeoJSONLayer(t,e){if(!(t instanceof r.GeoJSON))return;let s=null;if(e.geojson)s=JSON.parse(e.geojson);else if(e.url){const t=await fetch(e.url);if(!t.ok)throw new Error(`GeoJSON fetch failed: ${t.status} ${t.statusText}`);s=await t.json()}t.clearLayers(),t.addData(s)}async createGeoJSONLayer(t){let e=null;if(t.geojson)e=JSON.parse(t.geojson);else if(t.url){const s=await fetch(t.url);if(!s.ok)throw new Error(`GeoJSON fetch failed: ${s.status} ${s.statusText}`);e=await s.json()}if(e){let s={};if(t.geostylerStyle)s=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;s={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}return r.geoJSON(e,s)}return null}async createXYZLayer(t){return r.tileLayer(t.url,{attribution:this.normalizeAttribution(t.attributions),maxZoom:t.maxZoom??19,...t.options??{}})}async updateOSMLayer(t,e){if(!("setUrl"in t)||"function"!=typeof t.setUrl)return;let s="https://tile.openstreetmap.org/{z}/{x}/{y}.png";e.url&&(s=e.url+"/{z}/{x}/{y}.png"),t.setUrl(s)}async createOSMLayer(t){let e="https://tile.openstreetmap.org/{z}/{x}/{y}.png";return t.url&&(e=t.url+"/{z}/{x}/{y}.png"),r.tileLayer(e,{attribution:"© OpenStreetMap contributors",maxZoom:19})}async createWMSLayer(t){return r.tileLayer.wms(t.url,{layers:t.layers,format:t.format??"image/png",transparent:t.transparent??!0,...t.extraParams??{}})}buildArcGISUrl(t,e){if(!e||0===Object.keys(e).length)return t;const s=new URLSearchParams;return Object.entries(e).forEach((([t,e])=>{null!=e&&s.set(t,String(e))})),0===s.toString().length?t:`${t}${t.includes("?")?"&":"?"}${s.toString()}`}async createArcGISLayer(t){const e={...t.params??{}};t.token&&(e.token=t.token);const s=this.buildArcGISUrl(t.url,e),i={attribution:this.normalizeAttribution(t.attributions),minZoom:t.minZoom,maxZoom:t.maxZoom,...t.options??{}};return r.tileLayer(s,i)}async updateArcGISLayer(t,e){const s={...e?.params??{}};e?.token&&(s.token=e.token);const i=t,r=this.buildArcGISUrl(e?.url??i.options?.url??"",s);"setUrl"in i&&"function"==typeof i.setUrl&&i.setUrl(r)}async createGoogleLayer(t){if(!this.map)throw new Error("Map not initialized");if(!t.apiKey)throw new Error("Google-Layer benötigt 'apiKey' (Google Maps Platform).");const e="string"==typeof t.styles?this.tryParseStyles(t.styles):t.styles,s=new y({apiKey:t.apiKey,mapType:t.mapType??"roadmap",language:t.language,region:t.region,scale:t.scale,highDpi:t.highDpi,layerTypes:t.layerTypes,overlay:t.overlay,styles:Array.isArray(e)?e:void 0,imageFormat:t.imageFormat,apiOptions:t.apiOptions,maxZoom:t.maxZoom??22});return o=()=>{this.googleLogoAdded=!0,a("v-map - provider - leaflet - googleLogoAdded: ",this.googleLogoAdded)},(i=this.map)._googleLogoAdded||(new(r.Control.extend({onAdd(){const t=r.DomUtil.create("img");return t.src="https://developers.google.com/static/maps/documentation/images/google_on_white.png",t.alt="Google",t.style.pointerEvents="none",t.style.height="18px",t.style.margin="0 0 6px 6px",t},onRemove(){}}))({position:"bottomleft"}).addTo(i),i._googleLogoAdded=!0,o()),s;var i,o}tryParseStyles(t){try{const e=JSON.parse(t);return Array.isArray(e)?e:void 0}catch{return void o("Failed to parse Google styles JSON")}}async destroy(){var t;this.unsubscribeResize?.(),t=this.injectedStyle,this.shadowRoot&&t&&t.remove();for(const t of this.layers)this.map?.removeLayer(t);this.layers=[],this.map?.remove(),this.map=void 0}async setView([t,e],s){this.map?.setView([e,t],s,{animate:!1})}onLayerError(t,e){this.layerErrorCallbacks.set(t,e),this._getLayerById(t).then((s=>{if(!s)return;const i=()=>{e({type:"network",message:"Tile load error"})};s.on("tileerror",i),this.layerErrorCleanups.set(t,(()=>s.off("tileerror",i)))}))}offLayerError(t){this.layerErrorCleanups.get(t)?.(),this.layerErrorCleanups.delete(t),this.layerErrorCallbacks.delete(t)}async removeLayer(t){if(!t)return;this.offLayerError(t);const e=await this._getLayerById(t);e&&this.map.removeLayer(e)}async setZIndex(t,e){if(!t)return;const s=await this._getLayerById(t);s&&"function"==typeof s.setZIndex&&s.setZIndex(e)}async setOpacity(t,e){if(!t)return;const s=await this._getLayerById(t);this.setOpacityByLayer(s,e)}setOpacityByLayer(t,e){t&&(t.vmapOpacity=e,void 0===t.vmapVisible&&(t.vmapVisible=!0),!1!==t.vmapVisible&&this.setLayerOpacity(t,e))}async setVisible(t,e){if(!t)return;const s=await this._getLayerById(t);this.setVisibleByLayer(s,e)}setVisibleByLayer(t,e){t&&(t.vmapVisible=e,void 0===t.vmapOpacity&&(t.vmapOpacity=1),this.setLayerOpacity(t,e?t.vmapOpacity:0))}setLayerOpacity(t,e){if(!t)return;const s="number"==typeof e?e:e.opacity??1,i="number"==typeof e?e:e.fillOpacity??s,o=(t,e)=>{if(!(e in r))return!1;const s=r[e];return"function"==typeof s&&t instanceof s};var a;o(a=t,"GeoJSON")||o(a,"LayerGroup")?t.eachLayer((t=>this.setLayerOpacity(t,e))):(t=>o(t,"Path"))(t)?t.setStyle({opacity:s,fillOpacity:i}):((t=>o(t,"Marker"))(t)||"setOpacity"in t)&&t.setOpacity(s)}async ensureGroup(t,e,s){await this._ensureGroup(t,e)}async _ensureGroup(t,e){let s=await this._getLayerGroupById(t);return s||(s=r.layerGroup(),s._groupId=t,s.visible=!0,s.addTo(this.map),this.layers.push(s)),this.setGroupVisible(t,void 0===e||e),s}async _getLayerGroupById(t){if(!this.map)return null;let e=this.layers.find((e=>e instanceof r.LayerGroup&&e._groupId===t));return e||(e=this.hiddenLayerGroups.find((e=>e._groupId===t)),e)?e:null}async setGroupVisible(t,e){const s=await this._getLayerGroupById(t);if(s){if(s.visible===e)return;!1===s.visible?(s.addTo(this.map),this.hiddenLayerGroups=this.hiddenLayerGroups.filter((e=>e._groupId!==t)),s.visible=e):!0===s.visible&&(this.map.removeLayer(s),s.visible=e,this.hiddenLayerGroups.push(s))}}async updateWKTLayer(t,e){if(!(t instanceof r.GeoJSON))return;let s=null;if(e.wkt)s=await this.wktToGeoJSON(e.wkt);else if(e.url)try{const t=await fetch(e.url);if(!t.ok)throw new Error(`Failed to fetch WKT: ${t.status}`);const i=await t.text();s=await this.wktToGeoJSON(i)}catch(t){return void o("Failed to load WKT from URL:",t)}if(s){t.clearLayers();const i=t;i.options.style=this.createLeafletStyle(e.style),i.options.pointToLayer=(t,s)=>this.createLeafletPoint(t,s,e.style),i.options.onEachFeature=(t,s)=>this.bindLeafletPopup(t,s,e.style),i.addData(s)}}async createWKTLayer(t){let e=null;const s={type:"FeatureCollection",features:[]};if(t.wkt)e=await this.wktToGeoJSON(t.wkt);else if(t.url)try{const s=await fetch(t.url);if(!s.ok)throw new Error(`Failed to fetch WKT: ${s.status}`);const i=await s.text();e=await this.wktToGeoJSON(i)}catch(t){o("Failed to load WKT from URL:",t),e=s}else e=s;a("[Leaflet WKT] Creating layer with GeoJSON data:",e),a("[Leaflet WKT] Config:",t);let i={};if(t.geostylerStyle)i=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;i={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}a("[Leaflet WKT] Layer options:",i);const c=r.geoJSON(e,i);return a("[Leaflet WKT] Created layer:",c),"function"==typeof c.getBounds&&a("[Leaflet WKT] Layer bounds:",c.getBounds()),c}async wktToGeoJSON(t){try{const e=u.wellknown.parse(t);if(!e)throw new Error("Failed to parse WKT - returned null");const s={type:"Feature",geometry:e,properties:{}};return a("[Leaflet WKT] Input WKT:",t),a("[Leaflet WKT] Generated GeoJSON:",JSON.stringify(s,null,2)),{type:"FeatureCollection",features:[s]}}catch(e){return o("[Leaflet WKT] Failed to parse WKT:",t,e),{type:"FeatureCollection",features:[]}}}async createGeoTIFFLayer(t){if(!t.url)throw new Error("GeoTIFF layer requires a URL");try{const e=new d({url:t.url,tileSize:256,colorMap:t.colorMap,valueRange:t.valueRange,nodata:t.nodata,resolution:t.resolution,resampleMethod:t.resampleMethod,viewProjection:this.map.options.crs.code});return void 0!==t.opacity&&e.setOpacity?.(t.opacity),void 0!==t.zIndex&&e.setZIndex?.(t.zIndex),e}catch(t){return o("Failed to create GeoTIFF layer:",t),r.layerGroup([])}}async updateGeoTIFFLayer(t,e){if(!e.url)throw new Error("GeoTIFF update requires a URL");if(!t)return;if(!(t instanceof d))return;const s=e;await t.updateSource({url:e.url,colorMap:e.colorMap,valueRange:e.valueRange,nodata:e.nodata,resolution:s.resolution,resampleMethod:s.resampleMethod})}async createWCSLayer(t){if(!t.url)throw new Error("WCS layer requires a URL");if(!t.coverageName)throw new Error("WCS layer requires a coverageName");try{const e={url:t.url,coverageName:t.coverageName,version:t.version??"2.0.1",format:t.format??"image/tiff",projection:t.projection??"EPSG:4326",params:t.params};t.tileSize&&(e.tileSize=t.tileSize),void 0!==t.minZoom&&(e.minZoom=t.minZoom),void 0!==t.maxZoom&&(e.maxZoom=t.maxZoom);const s=new w(e);return void 0!==t.opacity&&s.setOpacity?.(t.opacity),void 0!==t.zIndex&&s.setZIndex?.(t.zIndex),s}catch(t){return o("[Leaflet WCS] Failed to create WCS layer:",t),r.layerGroup([])}}async updateWCSLayer(t,e){if(t&&t instanceof w){const s={};e.url&&(s.url=e.url),e.coverageName&&(s.coverageName=e.coverageName),e.version&&(s.version=e.version),e.format&&(s.format=e.format),e.projection&&(s.projection=e.projection),e.params&&(s.params=e.params),t.updateOptions(s)}}async createGeostylerLeafletOptions(t){const e=(t,e)=>null==t||"object"==typeof t&&t.name?e:t;return{style:s=>{const i=s?.geometry?.type;let r={};if(t.rules)for(const s of t.rules)if(s.symbolizers)for(const t of s.symbolizers)switch(t.kind){case"Fill":if("Polygon"===i||"MultiPolygon"===i){const s=e(t.color,"rgba(0,100,255,0.3)"),i=e(t.opacity,.3),o=e(t.outlineColor,"rgba(0,100,255,1)"),a=e(t.outlineWidth,1);r={...r,fillColor:s,fillOpacity:i,color:o,weight:a}}break;case"Line":const s=e(t.color,"rgba(0,100,255,1)"),o=e(t.width,2),a=t.dasharray&&Array.isArray(t.dasharray)?t.dasharray.map((t=>e(t,0))).join(","):void 0;r={...r,color:s,weight:o,dashArray:a}}return r},pointToLayer:(s,i)=>{if(t.rules)for(const s of t.rules)if(s.symbolizers)for(const t of s.symbolizers)switch(t.kind){case"Mark":const s=e(t.color,"rgba(0,100,255,1)"),o=e(t.radius,6),a=e(t.strokeColor,"rgba(0,100,255,1)"),n=e(t.strokeWidth,2);return r.circleMarker(i,{radius:o,fillColor:s,fillOpacity:1,color:a,weight:n});case"Icon":const c=e(t.image),l=e(t.size,32);if(c&&"string"==typeof c){const t=r.icon({iconUrl:c,iconSize:[l,l],iconAnchor:[l/2,l]});return r.marker(i,{icon:t})}}return r.circleMarker(i,{radius:6,fillColor:"rgba(0,100,255,1)",fillOpacity:1,color:"rgba(0,100,255,1)",weight:2})},onEachFeature:(s,i)=>{if(t.rules)for(const r of t.rules)if(r.symbolizers)for(const t of r.symbolizers)if("Text"===t.kind){const r=t.label;if(r&&"string"==typeof r&&s.properties&&s.properties[r]){const o=String(s.properties[r]),a=e(t.color,"#000000"),n=e(t.size,12);i.bindTooltip(`<div style="color: ${a}; font-size: ${n}px; font-family: Arial, sans-serif;">${o}</div>`,{permanent:!0,direction:"center",className:"leaflet-tooltip-custom"})}}}}}createLeafletStyle(t){return e=>{const s=e?.geometry?.type,i=t?.fillColor??"rgba(0,100,255,0.3)",r=t?.fillOpacity??.3,o=t?.strokeColor??"rgba(0,100,255,1)",a=t?.strokeOpacity??1,n=t?.strokeWidth??2;return"Polygon"===s||"MultiPolygon"===s?{fillColor:i,fillOpacity:r,color:o,opacity:a,weight:n,dashArray:t?.strokeDashArray?t.strokeDashArray.join(","):void 0}:"LineString"===s||"MultiLineString"===s?{color:o,opacity:a,weight:n,dashArray:t?.strokeDashArray?t.strokeDashArray.join(","):void 0}:{}}}createLeafletPoint(t,e,s){let i={...s??{}};if(s?.styleFunction){const e=s.styleFunction(t);e&&(i={...s,...e})}if(i?.iconUrl){const t=i.iconSize||[32,32],s=r.icon({iconUrl:i.iconUrl,iconSize:t,iconAnchor:i.iconAnchor||[t[0]/2,t[1]]});return r.marker(e,{icon:s})}{const t=i?.pointColor??"rgba(0,100,255,1)",s=i?.pointOpacity??1;return r.circleMarker(e,{radius:i?.pointRadius??6,fillColor:t,fillOpacity:s,color:i?.strokeColor??"rgba(0,100,255,1)",opacity:i?.strokeOpacity??1,weight:i?.strokeWidth??2})}}bindLeafletPopup(t,e,s){if(s?.textProperty&&t.properties&&t.properties[s.textProperty]){const i=String(t.properties[s.textProperty]);e.bindTooltip(`<div style="color: ${s?.textColor??"#000000"}; font-size: ${s?.textSize??12}px; font-family: Arial, sans-serif;">${i}</div>`,{permanent:!0,direction:"center",className:"leaflet-tooltip-custom"})}}async createWFSLayer(t){const e=await this.fetchWFSFromUrl(t);let s={};if(t.geostylerStyle)s=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;s={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}return r.geoJSON(e,s)}async updateWFSLayer(t,e){const s=await this.fetchWFSFromUrl(e);t.clearLayers(),t.addData(s)}async fetchWFSFromUrl(t){const e={service:"WFS",request:"GetFeature",version:t.version??"1.1.0",typeName:t.typeName,outputFormat:t.outputFormat??"application/json",srsName:t.srsName??"EPSG:4326",...t.params??{}},s=this.appendParams(t.url,e),i=await fetch(s);if(!i.ok)throw new Error(`WFS request failed (${i.status} ${i.statusText})`);const r=(t.outputFormat??"application/json").toLowerCase();if(r.includes("json")||r.includes("geojson")||"application/json"===r)return await i.json();if(r.includes("gml")||r.includes("xml")){const t=await i.text(),e=new f;return await e.parse(t)}return await i.json()}appendParams(t,e){const s=new URLSearchParams;return Object.entries(e).forEach((([t,e])=>{null!=e&&s.set(t,String(e))})),s.toString()?`${t}${t.includes("?")?"&":"?"}${s.toString()}`:t}getMap(){return this.map}}export{g as LeafletProvider}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r={Error:"vmap-error",MapProviderReady:"map-provider-ready",MapProviderWillShutdown:"map-provider-will-shutdown",MapMouseMove:"map-mousemove"};export{r as V}
|