mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
deploy: 9598b8abeb
This commit is contained in:
1
assets/LayersPanel-BajTPlsd.js
Normal file
1
assets/LayersPanel-BajTPlsd.js
Normal file
@@ -0,0 +1 @@
|
||||
import{h as d,i as l,c as u,S as C,f as F,x as S,d as P,b as A,e as I,j as $,u as O,l as T,s as E}from"./Frame-Cpo70DD7.js";var j=d('<div class="max-h-120 overflow-y-scroll max-w-200 divide-y app-divide">'),B=d('<div class=p-2><div> <span class=app-text-light></span></div><div class="text-xs font-mono app-text-light"></div><table class="font-mono table-auto border-separate border-spacing-x-2"><tbody>'),D=d('<tr><td class="text-right app-text-light break-keep"></td><td class=break-all>');const N=e=>e===1?"Point":e===2?"LineString":"Polygon",H=e=>(()=>{var o=j();return l(o,u(S,{get each(){return e.features},children:n=>(()=>{var x=B(),y=x.firstChild,m=y.firstChild,L=m.nextSibling,i=y.nextSibling,r=i.nextSibling,t=r.firstChild;return l(y,()=>n.layerName,m),l(L,()=>N(n.type)),l(i,u(C,{get when(){return n.id!==void 0},fallback:"missing ID",get children(){return["ID ",F(()=>n.id)]}})),l(t,u(S,{get each(){return Object.entries(n.properties)},children:([b,s])=>(()=>{var f=D(),a=f.firstChild,h=a.nextSibling;return l(a,b),l(h,()=>typeof s=="boolean"?JSON.stringify(s):s.toString()),f})()})),x})()})),o})();var R=d('<div><input type=checkbox id=background><label class="ml-2 text-sm"for=background>Background'),G=d('<div class="px-2 md:px-4 pb-2 md:pb-4"><div><input type=checkbox id=checkall><label class="ml-2 text-sm"for=checkall>All Layers'),J=d('<div class="app-bg rounded app-border flex flex-col overflow-y-scroll max-h-100"><button type=button class="app-well cursor-pointer min-w-8">'),M=d('<div class=ml-2><input type=checkbox><label class="ml-2 text-sm"><span class="inline-block mr-2 w-[10px] h-[10px]">'),q=d("<span class=ml-1>(<!>)");function K(e){let o;const[n,x]=A(!0),y=i=>{const r=e.layerVisibility().map(t=>t.id===i?{...t,visible:!t.visible}:t);e.setLayerVisibility(r)},m=F(()=>e.layerVisibility().filter(r=>r.visible).length===e.layerVisibility().length),L=()=>{e.setLayerVisibility(e.layerVisibility().map(i=>({...i,visible:!m()})))};return I(()=>{const i=e.layerVisibility().filter(t=>t.visible).length,r=i>0&&i!==e.layerVisibility().length;o&&(o.indeterminate=r)}),(()=>{var i=J(),r=i.firstChild;return r.$$click=()=>x(!n()),l(r,()=>n()?"-":"+"),l(i,u(C,{get when(){return n()},get children(){var t=G(),b=t.firstChild,s=b.firstChild;l(t,u(C,{get when(){return e.basemapOption},get children(){var a=R(),h=a.firstChild;return h.addEventListener("change",()=>e.setBasemap?.(!e.basemap?.())),$(()=>h.checked=e.basemap?.()),a}}),b),s.addEventListener("change",L);var f=o;return typeof f=="function"?O(f,s):o=s,l(t,u(S,{get each(){return e.layerVisibility()},children:(a,h)=>(()=>{var w=M(),_=w.firstChild,p=_.nextSibling,V=p.firstChild;return _.addEventListener("change",()=>y(a.id)),l(p,()=>a.id,null),l(p,u(C,{get when(){return e.layerFeatureCounts},children:c=>(()=>{var v=q(),k=v.firstChild,g=k.nextSibling;return g.nextSibling,l(v,()=>c()[a.id]||0,g),v})()}),null),$(c=>{var v=`check_${a.id}`,k=`check_${a.id}`,g=T(h());return v!==c.e&&E(_,"id",c.e=v),k!==c.t&&E(p,"for",c.t=k),g!==c.a&&((c.a=g)!=null?V.style.setProperty("background-color",g):V.style.removeProperty("background-color")),c},{e:void 0,t:void 0,a:void 0}),$(()=>_.checked=a.visible),w})()}),null),$(()=>s.checked=m()),t}}),null),$(t=>{var b=!!n(),s=!n();return b!==t.e&&r.classList.toggle("rounded-t",t.e=b),s!==t.t&&r.classList.toggle("rounded",t.t=s),t},{e:void 0,t:void 0}),i})()}P(["click"]);export{H as F,K as L};
|
||||
Reference in New Issue
Block a user