maplibre-gl-components 0.22.4 → 0.22.5
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/dist/{ControlGrid-8OFKKeLX.cjs → ControlGrid-BfZqV5oJ.cjs} +154 -154
- package/dist/{ControlGrid-DpjRo_3A.js → ControlGrid-kLyx6oLc.js} +3756 -3737
- package/dist/{DuckDBConverter-8ws0A8KE.cjs → DuckDBConverter-BgUGu-Gz.cjs} +1 -1
- package/dist/{ShapefileConverter-fb-NIFdJ.cjs → ShapefileConverter-Cc8SkbEm.cjs} +1 -1
- package/dist/{geotiff-IgdJXh1E.cjs → geotiff-C0210L8E.cjs} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lerc-AUf752bu.cjs → lerc-BLtd-Jnw.cjs} +1 -1
- package/dist/{maplibre-geoman.es-B4gcLNN-.cjs → maplibre-geoman.es-DYCjpnyF.cjs} +1 -1
- package/dist/maplibre-gl-components.css +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/types/lib/core/PMTilesLayer.d.ts +8 -0
- package/dist/types/lib/core/PMTilesLayer.d.ts.map +1 -1
- package/dist/types/lib/core/ZarrLayer.d.ts +8 -0
- package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -1
- package/dist/types/lib/utils/panelResize.d.ts +5 -3
- package/dist/types/lib/utils/panelResize.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./ControlGrid-8OFKKeLX.cjs");let r=require("react");function L({map:u,onStateChange:o,position:a="bottom-right",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.Colorbar({position:a,...e});return l.current=c,o&&(c.on("update",s=>{o(s.state)}),c.on("show",s=>{o(s.state)}),c.on("hide",s=>{o(s.state)})),u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u,a,o]),(0,r.useEffect)(()=>{if(l.current){const c=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));Object.keys(c).length>0&&l.current.update(c)}},[e.colormap,e.colorbars,e.colorStops,e.vmin,e.vmax,e.label,e.units,e.visible,e.orientation,e.barThickness,e.barLength,e.backgroundColor,e.opacity,e.fontSize,e.fontColor,e.minzoom,e.maxzoom]),null}function M({map:u,onStateChange:o,position:a="bottom-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.Legend({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("update",s),c.on("show",s),c.on("hide",s),c.on("collapse",s),c.on("expand",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u]),(0,r.useEffect)(()=>{if(l.current){const c=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));Object.keys(c).length>0&&l.current.update(c)}},[e.items,e.legends,e.title,e.visible,e.collapsed,e.collapsible,e.width,e.maxHeight,e.backgroundColor,e.opacity,e.fontSize,e.fontColor,e.swatchSize,e.minzoom,e.maxzoom]),null}function O({map:u,onStateChange:o,position:a="top-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.HtmlControl({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("update",s),c.on("show",s),c.on("hide",s),c.on("expand",s),c.on("collapse",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u,a,o]),(0,r.useEffect)(()=>{l.current&&e.html!==void 0&&l.current.setHtml(e.html)},[e.html]),(0,r.useEffect)(()=>{if(l.current){const c={};e.htmls!==void 0&&(c.htmls=e.htmls),e.visible!==void 0&&(c.visible=e.visible),e.title!==void 0&&(c.title=e.title),e.collapsible!==void 0&&(c.collapsible=e.collapsible),e.collapsed!==void 0&&(c.collapsed=e.collapsed),e.backgroundColor!==void 0&&(c.backgroundColor=e.backgroundColor),e.padding!==void 0&&(c.padding=e.padding),e.borderRadius!==void 0&&(c.borderRadius=e.borderRadius),e.opacity!==void 0&&(c.opacity=e.opacity),e.maxWidth!==void 0&&(c.maxWidth=e.maxWidth),e.maxHeight!==void 0&&(c.maxHeight=e.maxHeight),e.fontSize!==void 0&&(c.fontSize=e.fontSize),e.fontColor!==void 0&&(c.fontColor=e.fontColor),e.minzoom!==void 0&&(c.minzoom=e.minzoom),e.maxzoom!==void 0&&(c.maxzoom=e.maxzoom),Object.keys(c).length>0&&l.current.update(c)}},[e.visible,e.htmls,e.title,e.collapsible,e.collapsed,e.backgroundColor,e.padding,e.borderRadius,e.opacity,e.maxWidth,e.maxHeight,e.fontSize,e.fontColor,e.minzoom,e.maxzoom]),null}function S({map:u,onBasemapChange:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.BasemapControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("collapse",t),s.on("expand",t)}if(o){const t=d=>{d.basemap&&o(d.basemap)};s.on("basemapchange",t)}return u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u]),(0,r.useEffect)(()=>{if(c.current){const s=Object.fromEntries(Object.entries(l).filter(([,t])=>t!==void 0));Object.keys(s).length>0&&c.current.update(s)}},[l.basemaps,l.defaultBasemap,l.visible,l.collapsed,l.collapsible,l.displayMode,l.showSearch,l.filterGroups,l.excludeGroups,l.excludeBroken,l.backgroundColor,l.padding,l.borderRadius,l.opacity,l.maxWidth,l.maxHeight,l.fontSize,l.fontColor,l.minzoom,l.maxzoom]),null}function j({map:u,onTerrainChange:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.TerrainControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t)}if(o){const t=d=>{o(d.state.enabled)};s.on("terrainchange",t)}return u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u]),(0,r.useEffect)(()=>{if(c.current){const s=Object.fromEntries(Object.entries(l).filter(([,t])=>t!==void 0));Object.keys(s).length>0&&c.current.update(s)}},[l.enabled,l.exaggeration,l.hillshade,l.hillshadeExaggeration,l.visible,l.backgroundColor,l.borderRadius,l.opacity,l.minzoom,l.maxzoom]),null}function A({map:u,onResultSelect:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.SearchControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("expand",t),s.on("collapse",t),s.on("search",t),s.on("clear",t)}return o&&s.on("resultselect",t=>{t.result&&o(t.result)}),u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u,e,a,o]),(0,r.useEffect)(()=>{if(c.current){const s={};l.visible!==void 0&&(s.visible=l.visible),l.collapsed!==void 0&&(s.collapsed=l.collapsed),l.placeholder!==void 0&&(s.placeholder=l.placeholder),l.maxResults!==void 0&&(s.maxResults=l.maxResults),l.flyToZoom!==void 0&&(s.flyToZoom=l.flyToZoom),l.showMarker!==void 0&&(s.showMarker=l.showMarker),l.markerColor!==void 0&&(s.markerColor=l.markerColor),l.backgroundColor!==void 0&&(s.backgroundColor=l.backgroundColor),l.borderRadius!==void 0&&(s.borderRadius=l.borderRadius),l.opacity!==void 0&&(s.opacity=l.opacity),l.width!==void 0&&(s.width=l.width),l.fontSize!==void 0&&(s.fontSize=l.fontSize),l.fontColor!==void 0&&(s.fontColor=l.fontColor),l.minzoom!==void 0&&(s.minzoom=l.minzoom),l.maxzoom!==void 0&&(s.maxzoom=l.maxzoom),Object.keys(s).length>0&&c.current.update(s)}},[l.visible,l.collapsed,l.placeholder,l.maxResults,l.flyToZoom,l.showMarker,l.markerColor,l.backgroundColor,l.borderRadius,l.opacity,l.width,l.fontSize,l.fontColor,l.minzoom,l.maxzoom]),null}function B({map:u,onDatasetLoad:o,onError:a,onStateChange:e,position:l="top-right",...c}){const s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const t=new C.VectorDatasetControl({position:l,...c});if(s.current=t,e){const d=i=>{e(i.state)};t.on("update",d),t.on("show",d),t.on("hide",d)}if(o){const d=i=>{i.dataset&&o(i.dataset)};t.on("load",d)}if(a){const d=i=>{i.error&&a(i.error,i.filename)};t.on("error",d)}return u.addControl(t,l),()=>{u.hasControl(t)&&u.removeControl(t),s.current=null}},[u]),(0,r.useEffect)(()=>{if(s.current){const t=Object.fromEntries(Object.entries(c).filter(([,d])=>d!==void 0));Object.keys(t).length>0&&s.current.update(t)}},[c.visible,c.showDropZone,c.fitBounds,c.fitBoundsPadding,c.backgroundColor,c.borderRadius,c.opacity,c.minzoom,c.maxzoom]),null}function D({map:u,onFeatureSelect:o,onInspect:a,onToggle:e,onStateChange:l,position:c="top-right",...s}){const t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const d=new C.InspectControl({position:c,...s});if(t.current=d,l){const i=n=>{l(n.state)};d.on("update",i),d.on("show",i),d.on("hide",i),d.on("enable",i),d.on("disable",i),d.on("clear",i)}return o&&d.on("featureselect",i=>{o(i.feature||null)}),a&&d.on("featureselect",i=>{i.features&&a(i.features)}),e&&(d.on("enable",()=>e(!0)),d.on("disable",()=>e(!1))),u.addControl(d,c),()=>{u.hasControl(d)&&u.removeControl(d),t.current=null}},[u,c,l,o,a,e]),(0,r.useEffect)(()=>{if(t.current){const d={};s.visible!==void 0&&(d.visible=s.visible),s.enabled!==void 0&&(d.enabled=s.enabled),s.maxFeatures!==void 0&&(d.maxFeatures=s.maxFeatures),s.showGeometryType!==void 0&&(d.showGeometryType=s.showGeometryType),s.showLayerName!==void 0&&(d.showLayerName=s.showLayerName),s.maxWidth!==void 0&&(d.maxWidth=s.maxWidth),s.maxHeight!==void 0&&(d.maxHeight=s.maxHeight),s.backgroundColor!==void 0&&(d.backgroundColor=s.backgroundColor),s.borderRadius!==void 0&&(d.borderRadius=s.borderRadius),s.opacity!==void 0&&(d.opacity=s.opacity),s.fontSize!==void 0&&(d.fontSize=s.fontSize),s.fontColor!==void 0&&(d.fontColor=s.fontColor),s.minzoom!==void 0&&(d.minzoom=s.minzoom),s.maxzoom!==void 0&&(d.maxzoom=s.maxzoom),Object.keys(d).length>0&&t.current.update(d)}},[s.visible,s.enabled,s.maxFeatures,s.showGeometryType,s.showLayerName,s.maxWidth,s.maxHeight,s.backgroundColor,s.borderRadius,s.opacity,s.fontSize,s.fontColor,s.minzoom,s.maxzoom]),null}function H({map:u,onBBoxDraw:o,onDrawingToggle:a,onStateChange:e,position:l="bottom-left",...c}){const s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const t=new C.ViewStateControl({position:l,...c});if(s.current=t,e){const d=i=>{e(i.state)};t.on("update",d),t.on("show",d),t.on("hide",d),t.on("expand",d),t.on("collapse",d),t.on("viewchange",d)}return o&&t.on("bboxdraw",d=>{d.bbox&&o(d.bbox)}),a&&(t.on("drawstart",()=>a(!0)),t.on("drawend",()=>a(!1))),u.addControl(t,l),()=>{u.hasControl(t)&&u.removeControl(t),s.current=null}},[u,l,e,o,a]),(0,r.useEffect)(()=>{if(s.current){const t={};c.visible!==void 0&&(t.visible=c.visible),c.collapsed!==void 0&&(t.collapsed=c.collapsed),c.precision!==void 0&&(t.precision=c.precision),c.panelWidth!==void 0&&(t.panelWidth=c.panelWidth),c.backgroundColor!==void 0&&(t.backgroundColor=c.backgroundColor),c.borderRadius!==void 0&&(t.borderRadius=c.borderRadius),c.opacity!==void 0&&(t.opacity=c.opacity),c.fontSize!==void 0&&(t.fontSize=c.fontSize),c.fontColor!==void 0&&(t.fontColor=c.fontColor),c.minzoom!==void 0&&(t.minzoom=c.minzoom),c.maxzoom!==void 0&&(t.maxzoom=c.maxzoom),Object.keys(t).length>0&&s.current.update(t)}},[c.visible,c.collapsed,c.precision,c.panelWidth,c.backgroundColor,c.borderRadius,c.opacity,c.fontSize,c.fontColor,c.minzoom,c.maxzoom]),null}function I({map:u,onStateChange:o,position:a="top-right",controls:e=[],...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.ControlGrid({position:a,...l,controls:[]});if(c.current=s,o){const t=d=>{o(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("expand",t),s.on("collapse",t)}return u.addControl(s,a),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u,a,o]),(0,r.useEffect)(()=>{const s=c.current;if(!s)return;const t=s.getControls(),d=e;for(const i of d)t.includes(i)||s.addControl(i);for(const i of t)d.includes(i)||s.removeControl(i)},[e]),(0,r.useEffect)(()=>{const s=c.current;if(!s)return;const t={};l.visible!==void 0&&(t.visible=l.visible),l.collapsed!==void 0&&(t.collapsed=l.collapsed),l.title!==void 0&&(t.title=l.title),l.rows!==void 0&&(t.rows=l.rows),l.columns!==void 0&&(t.columns=l.columns),l.showRowColumnControls!==void 0&&(t.showRowColumnControls=l.showRowColumnControls),l.collapsible!==void 0&&(t.collapsible=l.collapsible),l.backgroundColor!==void 0&&(t.backgroundColor=l.backgroundColor),l.padding!==void 0&&(t.padding=l.padding),l.borderRadius!==void 0&&(t.borderRadius=l.borderRadius),l.opacity!==void 0&&(t.opacity=l.opacity),l.gap!==void 0&&(t.gap=l.gap),l.minzoom!==void 0&&(t.minzoom=l.minzoom),l.maxzoom!==void 0&&(t.maxzoom=l.maxzoom),Object.keys(t).length>0&&s.update(t)},[l.visible,l.collapsed,l.title,l.rows,l.columns,l.showRowColumnControls,l.collapsible,l.backgroundColor,l.padding,l.borderRadius,l.opacity,l.gap,l.minzoom,l.maxzoom]),null}function W({map:u,onLayerAdd:o,onLayerRemove:a,onLayerUpdate:e,onError:l,onStateChange:c,position:s="top-right",...t}){const d=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const i=new C.CogLayerControl({position:s,...t});if(d.current=i,c){const n=m=>{c(m.state)};i.on("update",n),i.on("show",n),i.on("hide",n),i.on("expand",n),i.on("collapse",n)}return o&&i.on("layeradd",n=>{n.url&&o(n.url)}),a&&i.on("layerremove",()=>{a()}),e&&i.on("layerupdate",n=>{n.url&&e(n.url)}),l&&i.on("error",n=>{n.error&&l(n.error)}),u.addControl(i,s),()=>{u.hasControl(i)&&u.removeControl(i),d.current=null}},[u]),(0,r.useEffect)(()=>{if(d.current){const i=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));Object.keys(i).length>0&&d.current.update(i)}},[t.visible,t.collapsed,t.backgroundColor,t.borderRadius,t.opacity,t.panelWidth,t.fontSize,t.fontColor,t.minzoom,t.maxzoom]),null}function _({map:u,onStateChange:o,position:a="bottom-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.MinimapControl({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("show",s),c.on("hide",s),c.on("expand",s),c.on("collapse",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u]),null}var h={visible:!0,vmin:0,vmax:1,colormap:"viridis"};function G(u){const[o,a]=(0,r.useState)({...h,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setVmin:(0,r.useCallback)(e=>{a(l=>({...l,vmin:e}))},[]),setVmax:(0,r.useCallback)(e=>{a(l=>({...l,vmax:e}))},[]),setRange:(0,r.useCallback)((e,l)=>{a(c=>({...c,vmin:e,vmax:l}))},[]),setColormap:(0,r.useCallback)(e=>{a(l=>({...l,colormap:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),reset:(0,r.useCallback)(()=>{a({...h,...u})},[u])}}var k={visible:!0,collapsed:!1,items:[]};function U(u){const[o,a]=(0,r.useState)({...k,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setItems:(0,r.useCallback)(e=>{a(l=>({...l,items:[...e]}))},[]),addItem:(0,r.useCallback)(e=>{a(l=>({...l,items:[...l.items,e]}))},[]),removeItem:(0,r.useCallback)(e=>{a(l=>({...l,items:l.items.filter(c=>c.label!==e)}))},[]),updateItem:(0,r.useCallback)((e,l)=>{a(c=>({...c,items:c.items.map(s=>s.label===e?{...s,...l}:s)}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),reset:(0,r.useCallback)(()=>{a({...k,...u})},[u])}}var v={visible:!0,collapsed:!1,html:""};function $(u){const[o,a]=(0,r.useState)({...v,...u}),e=(0,r.useCallback)(d=>{a(i=>({...i,visible:d}))},[]),l=(0,r.useCallback)(d=>{a(i=>({...i,html:d}))},[]),c=(0,r.useCallback)(()=>{a(d=>({...d,visible:!0}))},[]),s=(0,r.useCallback)(()=>{a(d=>({...d,visible:!1}))},[]),t=(0,r.useCallback)(()=>{a(d=>({...d,visible:!d.visible}))},[]);return{state:o,setState:a,setVisible:e,setHtml:l,setCollapsed:(0,r.useCallback)(d=>{a(i=>({...i,collapsed:d}))},[]),show:c,hide:s,expand:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!d.collapsed}))},[]),toggleVisibility:t,reset:(0,r.useCallback)(()=>{a({...v,...u})},[u])}}var g={visible:!0,collapsed:!0,selectedBasemap:null,searchText:"",loading:!1,error:null,belowLabels:!1};function N(u){const[o,a]=(0,r.useState)({...g,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setBasemap:(0,r.useCallback)(e=>{a(l=>({...l,selectedBasemap:e}))},[]),setSearch:(0,r.useCallback)(e=>{a(l=>({...l,searchText:e}))},[]),setLoading:(0,r.useCallback)(e=>{a(l=>({...l,loading:e}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),setBelowLabels:(0,r.useCallback)(e=>{a(l=>({...l,belowLabels:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),clearSearch:(0,r.useCallback)(()=>{a(e=>({...e,searchText:""}))},[]),reset:(0,r.useCallback)(()=>{a({...g,...u})},[u])}}var x={visible:!0,enabled:!1,exaggeration:1,hillshade:!0};function q(u){const[o,a]=(0,r.useState)({...x,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setEnabled:(0,r.useCallback)(e=>{a(l=>({...l,enabled:e}))},[]),setExaggeration:(0,r.useCallback)(e=>{const l=Math.max(.1,Math.min(10,e));a(c=>({...c,exaggeration:l}))},[]),setHillshade:(0,r.useCallback)(e=>{a(l=>({...l,hillshade:e}))},[]),enable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!0}))},[]),disable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!1}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!e.enabled}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),enableHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!0}))},[]),disableHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!1}))},[]),toggleHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!e.hillshade}))},[]),reset:(0,r.useCallback)(()=>{a({...x,...u})},[u])}}var R={visible:!0,collapsed:!0,query:"",results:[],loading:!1,selectedResult:null,error:null};function Z(u){const[o,a]=(0,r.useState)({...R,...u}),e=(0,r.useCallback)(b=>{a(f=>({...f,visible:b}))},[]),l=(0,r.useCallback)(b=>{a(f=>({...f,collapsed:b}))},[]),c=(0,r.useCallback)(b=>{a(f=>({...f,query:b}))},[]),s=(0,r.useCallback)(b=>{a(f=>({...f,results:b}))},[]),t=(0,r.useCallback)(b=>{a(f=>({...f,loading:b}))},[]),d=(0,r.useCallback)(b=>{a(f=>({...f,selectedResult:b}))},[]),i=(0,r.useCallback)(b=>{a(f=>({...f,error:b}))},[]),n=(0,r.useCallback)(()=>{a(b=>({...b,visible:!0}))},[]),m=(0,r.useCallback)(()=>{a(b=>({...b,visible:!1}))},[]),V=(0,r.useCallback)(()=>{a(b=>({...b,visible:!b.visible}))},[]);return{state:o,setState:a,setVisible:e,setCollapsed:l,setQuery:c,setResults:s,setLoading:t,selectResult:d,setError:i,show:n,hide:m,expand:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!0,results:[]}))},[]),toggle:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!b.collapsed,results:b.collapsed?b.results:[]}))},[]),toggleVisibility:V,clear:(0,r.useCallback)(()=>{a(b=>({...b,query:"",results:[],selectedResult:null,error:null}))},[]),reset:(0,r.useCallback)(()=>{a({...R,...u})},[u])}}var w={visible:!0,isDragging:!1,isLoading:!1,loadedDatasets:[],error:null};function P(u){const[o,a]=(0,r.useState)({...w,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),addDataset:(0,r.useCallback)(e=>{a(l=>({...l,loadedDatasets:[...l.loadedDatasets,e],error:null}))},[]),removeDataset:(0,r.useCallback)(e=>{a(l=>({...l,loadedDatasets:l.loadedDatasets.filter(c=>c.id!==e)}))},[]),clearAll:(0,r.useCallback)(()=>{a(e=>({...e,loadedDatasets:[]}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),clearError:(0,r.useCallback)(()=>{a(e=>({...e,error:null}))},[]),reset:(0,r.useCallback)(()=>{a({...w,...u})},[u])}}var y={visible:!0,enabled:!1,inspectedFeatures:[],selectedIndex:0,error:null};function Q(u){const[o,a]=(0,r.useState)({...y,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setEnabled:(0,r.useCallback)(e=>{a(l=>({...l,enabled:e}))},[]),enable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!0}))},[]),disable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!1,inspectedFeatures:[],selectedIndex:0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!e.enabled,inspectedFeatures:e.enabled?[]:e.inspectedFeatures,selectedIndex:e.enabled?0:e.selectedIndex}))},[]),setInspectedFeatures:(0,r.useCallback)(e=>{a(l=>({...l,inspectedFeatures:e,selectedIndex:0}))},[]),selectFeature:(0,r.useCallback)(e=>{a(l=>({...l,selectedIndex:Math.max(0,Math.min(e,l.inspectedFeatures.length-1))}))},[]),nextFeature:(0,r.useCallback)(()=>{a(e=>e.inspectedFeatures.length<=1?e:{...e,selectedIndex:(e.selectedIndex+1)%e.inspectedFeatures.length})},[]),previousFeature:(0,r.useCallback)(()=>{a(e=>e.inspectedFeatures.length<=1?e:{...e,selectedIndex:e.selectedIndex===0?e.inspectedFeatures.length-1:e.selectedIndex-1})},[]),clear:(0,r.useCallback)(()=>{a(e=>({...e,inspectedFeatures:[],selectedIndex:0,error:null}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...y,...u})},[u]),currentFeature:o.inspectedFeatures[o.selectedIndex]||null,featureCount:o.inspectedFeatures.length}}var z={visible:!0,collapsed:!0,center:[0,0],bounds:[0,0,0,0],zoom:0,pitch:0,bearing:0,drawingBBox:!1,drawnBBox:null};function J(u){const[o,a]=(0,r.useState)({...z,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),setDrawingBBox:(0,r.useCallback)(e=>{a(l=>({...l,drawingBBox:e}))},[]),setDrawnBBox:(0,r.useCallback)(e=>{a(l=>({...l,drawnBBox:e}))},[]),clearBBox:(0,r.useCallback)(()=>{a(e=>({...e,drawnBBox:null,drawingBBox:!1}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...z,...u})},[u])}}var E={visible:!0,collapsed:!1,rows:2,columns:2};function K(u){const[o,a]=(0,r.useState)({...E,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setRows:(0,r.useCallback)(e=>{a(l=>({...l,rows:Math.max(1,Math.min(12,Math.round(e)))}))},[]),setColumns:(0,r.useCallback)(e=>{a(l=>({...l,columns:Math.max(1,Math.min(12,Math.round(e)))}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...E,...u})},[u])}}var T={visible:!0,collapsed:!0,url:"",bands:"1",colormap:"viridis",rescaleMin:0,rescaleMax:255,nodata:void 0,layerOpacity:1,pickable:!0,hasLayer:!1,layerCount:0,layers:[],loading:!1,error:null,status:null,layerName:""};function X(u){const[o,a]=(0,r.useState)({...T,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setUrl:(0,r.useCallback)(e=>{a(l=>({...l,url:e}))},[]),setBands:(0,r.useCallback)(e=>{a(l=>({...l,bands:e}))},[]),setColormap:(0,r.useCallback)(e=>{a(l=>({...l,colormap:e}))},[]),setRescaleMin:(0,r.useCallback)(e=>{a(l=>({...l,rescaleMin:e}))},[]),setRescaleMax:(0,r.useCallback)(e=>{a(l=>({...l,rescaleMax:e}))},[]),setNodata:(0,r.useCallback)(e=>{a(l=>({...l,nodata:e}))},[]),setOpacity:(0,r.useCallback)(e=>{const l=Math.max(0,Math.min(1,e));a(c=>({...c,layerOpacity:l}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),togglePanel:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),reset:(0,r.useCallback)(()=>{a({...T,...u})},[u])}}var F={visible:!0,collapsed:!1};function Y(u){const[o,a]=(0,r.useState)({...F,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),reset:(0,r.useCallback)(()=>{a({...F,...u})},[u])}}exports.BasemapReact=S;exports.CogLayerReact=W;exports.ColorbarReact=L;exports.ControlGridReact=I;exports.HtmlControlReact=O;exports.InspectControlReact=D;exports.LegendReact=M;exports.MinimapControlReact=_;exports.SearchControlReact=A;exports.TerrainReact=j;exports.VectorDatasetReact=B;exports.ViewStateControlReact=H;exports.useBasemap=N;exports.useCogLayer=X;exports.useColorbar=G;exports.useControlGrid=K;exports.useHtmlControl=$;exports.useInspectControl=Q;exports.useLegend=U;exports.useMinimapControl=Y;exports.useSearchControl=Z;exports.useTerrain=q;exports.useVectorDataset=P;exports.useViewState=J;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./ControlGrid-BfZqV5oJ.cjs");let r=require("react");function L({map:u,onStateChange:o,position:a="bottom-right",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.Colorbar({position:a,...e});return l.current=c,o&&(c.on("update",s=>{o(s.state)}),c.on("show",s=>{o(s.state)}),c.on("hide",s=>{o(s.state)})),u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u,a,o]),(0,r.useEffect)(()=>{if(l.current){const c=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));Object.keys(c).length>0&&l.current.update(c)}},[e.colormap,e.colorbars,e.colorStops,e.vmin,e.vmax,e.label,e.units,e.visible,e.orientation,e.barThickness,e.barLength,e.backgroundColor,e.opacity,e.fontSize,e.fontColor,e.minzoom,e.maxzoom]),null}function M({map:u,onStateChange:o,position:a="bottom-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.Legend({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("update",s),c.on("show",s),c.on("hide",s),c.on("collapse",s),c.on("expand",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u]),(0,r.useEffect)(()=>{if(l.current){const c=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));Object.keys(c).length>0&&l.current.update(c)}},[e.items,e.legends,e.title,e.visible,e.collapsed,e.collapsible,e.width,e.maxHeight,e.backgroundColor,e.opacity,e.fontSize,e.fontColor,e.swatchSize,e.minzoom,e.maxzoom]),null}function O({map:u,onStateChange:o,position:a="top-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.HtmlControl({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("update",s),c.on("show",s),c.on("hide",s),c.on("expand",s),c.on("collapse",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u,a,o]),(0,r.useEffect)(()=>{l.current&&e.html!==void 0&&l.current.setHtml(e.html)},[e.html]),(0,r.useEffect)(()=>{if(l.current){const c={};e.htmls!==void 0&&(c.htmls=e.htmls),e.visible!==void 0&&(c.visible=e.visible),e.title!==void 0&&(c.title=e.title),e.collapsible!==void 0&&(c.collapsible=e.collapsible),e.collapsed!==void 0&&(c.collapsed=e.collapsed),e.backgroundColor!==void 0&&(c.backgroundColor=e.backgroundColor),e.padding!==void 0&&(c.padding=e.padding),e.borderRadius!==void 0&&(c.borderRadius=e.borderRadius),e.opacity!==void 0&&(c.opacity=e.opacity),e.maxWidth!==void 0&&(c.maxWidth=e.maxWidth),e.maxHeight!==void 0&&(c.maxHeight=e.maxHeight),e.fontSize!==void 0&&(c.fontSize=e.fontSize),e.fontColor!==void 0&&(c.fontColor=e.fontColor),e.minzoom!==void 0&&(c.minzoom=e.minzoom),e.maxzoom!==void 0&&(c.maxzoom=e.maxzoom),Object.keys(c).length>0&&l.current.update(c)}},[e.visible,e.htmls,e.title,e.collapsible,e.collapsed,e.backgroundColor,e.padding,e.borderRadius,e.opacity,e.maxWidth,e.maxHeight,e.fontSize,e.fontColor,e.minzoom,e.maxzoom]),null}function S({map:u,onBasemapChange:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.BasemapControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("collapse",t),s.on("expand",t)}if(o){const t=d=>{d.basemap&&o(d.basemap)};s.on("basemapchange",t)}return u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u]),(0,r.useEffect)(()=>{if(c.current){const s=Object.fromEntries(Object.entries(l).filter(([,t])=>t!==void 0));Object.keys(s).length>0&&c.current.update(s)}},[l.basemaps,l.defaultBasemap,l.visible,l.collapsed,l.collapsible,l.displayMode,l.showSearch,l.filterGroups,l.excludeGroups,l.excludeBroken,l.backgroundColor,l.padding,l.borderRadius,l.opacity,l.maxWidth,l.maxHeight,l.fontSize,l.fontColor,l.minzoom,l.maxzoom]),null}function j({map:u,onTerrainChange:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.TerrainControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t)}if(o){const t=d=>{o(d.state.enabled)};s.on("terrainchange",t)}return u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u]),(0,r.useEffect)(()=>{if(c.current){const s=Object.fromEntries(Object.entries(l).filter(([,t])=>t!==void 0));Object.keys(s).length>0&&c.current.update(s)}},[l.enabled,l.exaggeration,l.hillshade,l.hillshadeExaggeration,l.visible,l.backgroundColor,l.borderRadius,l.opacity,l.minzoom,l.maxzoom]),null}function A({map:u,onResultSelect:o,onStateChange:a,position:e="top-right",...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.SearchControl({position:e,...l});if(c.current=s,a){const t=d=>{a(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("expand",t),s.on("collapse",t),s.on("search",t),s.on("clear",t)}return o&&s.on("resultselect",t=>{t.result&&o(t.result)}),u.addControl(s,e),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u,e,a,o]),(0,r.useEffect)(()=>{if(c.current){const s={};l.visible!==void 0&&(s.visible=l.visible),l.collapsed!==void 0&&(s.collapsed=l.collapsed),l.placeholder!==void 0&&(s.placeholder=l.placeholder),l.maxResults!==void 0&&(s.maxResults=l.maxResults),l.flyToZoom!==void 0&&(s.flyToZoom=l.flyToZoom),l.showMarker!==void 0&&(s.showMarker=l.showMarker),l.markerColor!==void 0&&(s.markerColor=l.markerColor),l.backgroundColor!==void 0&&(s.backgroundColor=l.backgroundColor),l.borderRadius!==void 0&&(s.borderRadius=l.borderRadius),l.opacity!==void 0&&(s.opacity=l.opacity),l.width!==void 0&&(s.width=l.width),l.fontSize!==void 0&&(s.fontSize=l.fontSize),l.fontColor!==void 0&&(s.fontColor=l.fontColor),l.minzoom!==void 0&&(s.minzoom=l.minzoom),l.maxzoom!==void 0&&(s.maxzoom=l.maxzoom),Object.keys(s).length>0&&c.current.update(s)}},[l.visible,l.collapsed,l.placeholder,l.maxResults,l.flyToZoom,l.showMarker,l.markerColor,l.backgroundColor,l.borderRadius,l.opacity,l.width,l.fontSize,l.fontColor,l.minzoom,l.maxzoom]),null}function B({map:u,onDatasetLoad:o,onError:a,onStateChange:e,position:l="top-right",...c}){const s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const t=new C.VectorDatasetControl({position:l,...c});if(s.current=t,e){const d=i=>{e(i.state)};t.on("update",d),t.on("show",d),t.on("hide",d)}if(o){const d=i=>{i.dataset&&o(i.dataset)};t.on("load",d)}if(a){const d=i=>{i.error&&a(i.error,i.filename)};t.on("error",d)}return u.addControl(t,l),()=>{u.hasControl(t)&&u.removeControl(t),s.current=null}},[u]),(0,r.useEffect)(()=>{if(s.current){const t=Object.fromEntries(Object.entries(c).filter(([,d])=>d!==void 0));Object.keys(t).length>0&&s.current.update(t)}},[c.visible,c.showDropZone,c.fitBounds,c.fitBoundsPadding,c.backgroundColor,c.borderRadius,c.opacity,c.minzoom,c.maxzoom]),null}function D({map:u,onFeatureSelect:o,onInspect:a,onToggle:e,onStateChange:l,position:c="top-right",...s}){const t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const d=new C.InspectControl({position:c,...s});if(t.current=d,l){const i=n=>{l(n.state)};d.on("update",i),d.on("show",i),d.on("hide",i),d.on("enable",i),d.on("disable",i),d.on("clear",i)}return o&&d.on("featureselect",i=>{o(i.feature||null)}),a&&d.on("featureselect",i=>{i.features&&a(i.features)}),e&&(d.on("enable",()=>e(!0)),d.on("disable",()=>e(!1))),u.addControl(d,c),()=>{u.hasControl(d)&&u.removeControl(d),t.current=null}},[u,c,l,o,a,e]),(0,r.useEffect)(()=>{if(t.current){const d={};s.visible!==void 0&&(d.visible=s.visible),s.enabled!==void 0&&(d.enabled=s.enabled),s.maxFeatures!==void 0&&(d.maxFeatures=s.maxFeatures),s.showGeometryType!==void 0&&(d.showGeometryType=s.showGeometryType),s.showLayerName!==void 0&&(d.showLayerName=s.showLayerName),s.maxWidth!==void 0&&(d.maxWidth=s.maxWidth),s.maxHeight!==void 0&&(d.maxHeight=s.maxHeight),s.backgroundColor!==void 0&&(d.backgroundColor=s.backgroundColor),s.borderRadius!==void 0&&(d.borderRadius=s.borderRadius),s.opacity!==void 0&&(d.opacity=s.opacity),s.fontSize!==void 0&&(d.fontSize=s.fontSize),s.fontColor!==void 0&&(d.fontColor=s.fontColor),s.minzoom!==void 0&&(d.minzoom=s.minzoom),s.maxzoom!==void 0&&(d.maxzoom=s.maxzoom),Object.keys(d).length>0&&t.current.update(d)}},[s.visible,s.enabled,s.maxFeatures,s.showGeometryType,s.showLayerName,s.maxWidth,s.maxHeight,s.backgroundColor,s.borderRadius,s.opacity,s.fontSize,s.fontColor,s.minzoom,s.maxzoom]),null}function H({map:u,onBBoxDraw:o,onDrawingToggle:a,onStateChange:e,position:l="bottom-left",...c}){const s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const t=new C.ViewStateControl({position:l,...c});if(s.current=t,e){const d=i=>{e(i.state)};t.on("update",d),t.on("show",d),t.on("hide",d),t.on("expand",d),t.on("collapse",d),t.on("viewchange",d)}return o&&t.on("bboxdraw",d=>{d.bbox&&o(d.bbox)}),a&&(t.on("drawstart",()=>a(!0)),t.on("drawend",()=>a(!1))),u.addControl(t,l),()=>{u.hasControl(t)&&u.removeControl(t),s.current=null}},[u,l,e,o,a]),(0,r.useEffect)(()=>{if(s.current){const t={};c.visible!==void 0&&(t.visible=c.visible),c.collapsed!==void 0&&(t.collapsed=c.collapsed),c.precision!==void 0&&(t.precision=c.precision),c.panelWidth!==void 0&&(t.panelWidth=c.panelWidth),c.backgroundColor!==void 0&&(t.backgroundColor=c.backgroundColor),c.borderRadius!==void 0&&(t.borderRadius=c.borderRadius),c.opacity!==void 0&&(t.opacity=c.opacity),c.fontSize!==void 0&&(t.fontSize=c.fontSize),c.fontColor!==void 0&&(t.fontColor=c.fontColor),c.minzoom!==void 0&&(t.minzoom=c.minzoom),c.maxzoom!==void 0&&(t.maxzoom=c.maxzoom),Object.keys(t).length>0&&s.current.update(t)}},[c.visible,c.collapsed,c.precision,c.panelWidth,c.backgroundColor,c.borderRadius,c.opacity,c.fontSize,c.fontColor,c.minzoom,c.maxzoom]),null}function I({map:u,onStateChange:o,position:a="top-right",controls:e=[],...l}){const c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const s=new C.ControlGrid({position:a,...l,controls:[]});if(c.current=s,o){const t=d=>{o(d.state)};s.on("update",t),s.on("show",t),s.on("hide",t),s.on("expand",t),s.on("collapse",t)}return u.addControl(s,a),()=>{u.hasControl(s)&&u.removeControl(s),c.current=null}},[u,a,o]),(0,r.useEffect)(()=>{const s=c.current;if(!s)return;const t=s.getControls(),d=e;for(const i of d)t.includes(i)||s.addControl(i);for(const i of t)d.includes(i)||s.removeControl(i)},[e]),(0,r.useEffect)(()=>{const s=c.current;if(!s)return;const t={};l.visible!==void 0&&(t.visible=l.visible),l.collapsed!==void 0&&(t.collapsed=l.collapsed),l.title!==void 0&&(t.title=l.title),l.rows!==void 0&&(t.rows=l.rows),l.columns!==void 0&&(t.columns=l.columns),l.showRowColumnControls!==void 0&&(t.showRowColumnControls=l.showRowColumnControls),l.collapsible!==void 0&&(t.collapsible=l.collapsible),l.backgroundColor!==void 0&&(t.backgroundColor=l.backgroundColor),l.padding!==void 0&&(t.padding=l.padding),l.borderRadius!==void 0&&(t.borderRadius=l.borderRadius),l.opacity!==void 0&&(t.opacity=l.opacity),l.gap!==void 0&&(t.gap=l.gap),l.minzoom!==void 0&&(t.minzoom=l.minzoom),l.maxzoom!==void 0&&(t.maxzoom=l.maxzoom),Object.keys(t).length>0&&s.update(t)},[l.visible,l.collapsed,l.title,l.rows,l.columns,l.showRowColumnControls,l.collapsible,l.backgroundColor,l.padding,l.borderRadius,l.opacity,l.gap,l.minzoom,l.maxzoom]),null}function W({map:u,onLayerAdd:o,onLayerRemove:a,onLayerUpdate:e,onError:l,onStateChange:c,position:s="top-right",...t}){const d=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const i=new C.CogLayerControl({position:s,...t});if(d.current=i,c){const n=m=>{c(m.state)};i.on("update",n),i.on("show",n),i.on("hide",n),i.on("expand",n),i.on("collapse",n)}return o&&i.on("layeradd",n=>{n.url&&o(n.url)}),a&&i.on("layerremove",()=>{a()}),e&&i.on("layerupdate",n=>{n.url&&e(n.url)}),l&&i.on("error",n=>{n.error&&l(n.error)}),u.addControl(i,s),()=>{u.hasControl(i)&&u.removeControl(i),d.current=null}},[u]),(0,r.useEffect)(()=>{if(d.current){const i=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));Object.keys(i).length>0&&d.current.update(i)}},[t.visible,t.collapsed,t.backgroundColor,t.borderRadius,t.opacity,t.panelWidth,t.fontSize,t.fontColor,t.minzoom,t.maxzoom]),null}function _({map:u,onStateChange:o,position:a="bottom-left",...e}){const l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!u)return;const c=new C.MinimapControl({position:a,...e});if(l.current=c,o){const s=t=>{o(t.state)};c.on("show",s),c.on("hide",s),c.on("expand",s),c.on("collapse",s)}return u.addControl(c,a),()=>{u.hasControl(c)&&u.removeControl(c),l.current=null}},[u]),null}var h={visible:!0,vmin:0,vmax:1,colormap:"viridis"};function G(u){const[o,a]=(0,r.useState)({...h,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setVmin:(0,r.useCallback)(e=>{a(l=>({...l,vmin:e}))},[]),setVmax:(0,r.useCallback)(e=>{a(l=>({...l,vmax:e}))},[]),setRange:(0,r.useCallback)((e,l)=>{a(c=>({...c,vmin:e,vmax:l}))},[]),setColormap:(0,r.useCallback)(e=>{a(l=>({...l,colormap:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),reset:(0,r.useCallback)(()=>{a({...h,...u})},[u])}}var k={visible:!0,collapsed:!1,items:[]};function U(u){const[o,a]=(0,r.useState)({...k,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setItems:(0,r.useCallback)(e=>{a(l=>({...l,items:[...e]}))},[]),addItem:(0,r.useCallback)(e=>{a(l=>({...l,items:[...l.items,e]}))},[]),removeItem:(0,r.useCallback)(e=>{a(l=>({...l,items:l.items.filter(c=>c.label!==e)}))},[]),updateItem:(0,r.useCallback)((e,l)=>{a(c=>({...c,items:c.items.map(s=>s.label===e?{...s,...l}:s)}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),reset:(0,r.useCallback)(()=>{a({...k,...u})},[u])}}var v={visible:!0,collapsed:!1,html:""};function $(u){const[o,a]=(0,r.useState)({...v,...u}),e=(0,r.useCallback)(d=>{a(i=>({...i,visible:d}))},[]),l=(0,r.useCallback)(d=>{a(i=>({...i,html:d}))},[]),c=(0,r.useCallback)(()=>{a(d=>({...d,visible:!0}))},[]),s=(0,r.useCallback)(()=>{a(d=>({...d,visible:!1}))},[]),t=(0,r.useCallback)(()=>{a(d=>({...d,visible:!d.visible}))},[]);return{state:o,setState:a,setVisible:e,setHtml:l,setCollapsed:(0,r.useCallback)(d=>{a(i=>({...i,collapsed:d}))},[]),show:c,hide:s,expand:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(d=>({...d,collapsed:!d.collapsed}))},[]),toggleVisibility:t,reset:(0,r.useCallback)(()=>{a({...v,...u})},[u])}}var g={visible:!0,collapsed:!0,selectedBasemap:null,searchText:"",loading:!1,error:null,belowLabels:!1};function N(u){const[o,a]=(0,r.useState)({...g,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setBasemap:(0,r.useCallback)(e=>{a(l=>({...l,selectedBasemap:e}))},[]),setSearch:(0,r.useCallback)(e=>{a(l=>({...l,searchText:e}))},[]),setLoading:(0,r.useCallback)(e=>{a(l=>({...l,loading:e}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),setBelowLabels:(0,r.useCallback)(e=>{a(l=>({...l,belowLabels:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),clearSearch:(0,r.useCallback)(()=>{a(e=>({...e,searchText:""}))},[]),reset:(0,r.useCallback)(()=>{a({...g,...u})},[u])}}var x={visible:!0,enabled:!1,exaggeration:1,hillshade:!0};function q(u){const[o,a]=(0,r.useState)({...x,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setEnabled:(0,r.useCallback)(e=>{a(l=>({...l,enabled:e}))},[]),setExaggeration:(0,r.useCallback)(e=>{const l=Math.max(.1,Math.min(10,e));a(c=>({...c,exaggeration:l}))},[]),setHillshade:(0,r.useCallback)(e=>{a(l=>({...l,hillshade:e}))},[]),enable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!0}))},[]),disable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!1}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!e.enabled}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),enableHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!0}))},[]),disableHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!1}))},[]),toggleHillshade:(0,r.useCallback)(()=>{a(e=>({...e,hillshade:!e.hillshade}))},[]),reset:(0,r.useCallback)(()=>{a({...x,...u})},[u])}}var R={visible:!0,collapsed:!0,query:"",results:[],loading:!1,selectedResult:null,error:null};function Z(u){const[o,a]=(0,r.useState)({...R,...u}),e=(0,r.useCallback)(b=>{a(f=>({...f,visible:b}))},[]),l=(0,r.useCallback)(b=>{a(f=>({...f,collapsed:b}))},[]),c=(0,r.useCallback)(b=>{a(f=>({...f,query:b}))},[]),s=(0,r.useCallback)(b=>{a(f=>({...f,results:b}))},[]),t=(0,r.useCallback)(b=>{a(f=>({...f,loading:b}))},[]),d=(0,r.useCallback)(b=>{a(f=>({...f,selectedResult:b}))},[]),i=(0,r.useCallback)(b=>{a(f=>({...f,error:b}))},[]),n=(0,r.useCallback)(()=>{a(b=>({...b,visible:!0}))},[]),m=(0,r.useCallback)(()=>{a(b=>({...b,visible:!1}))},[]),V=(0,r.useCallback)(()=>{a(b=>({...b,visible:!b.visible}))},[]);return{state:o,setState:a,setVisible:e,setCollapsed:l,setQuery:c,setResults:s,setLoading:t,selectResult:d,setError:i,show:n,hide:m,expand:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!0,results:[]}))},[]),toggle:(0,r.useCallback)(()=>{a(b=>({...b,collapsed:!b.collapsed,results:b.collapsed?b.results:[]}))},[]),toggleVisibility:V,clear:(0,r.useCallback)(()=>{a(b=>({...b,query:"",results:[],selectedResult:null,error:null}))},[]),reset:(0,r.useCallback)(()=>{a({...R,...u})},[u])}}var w={visible:!0,isDragging:!1,isLoading:!1,loadedDatasets:[],error:null};function P(u){const[o,a]=(0,r.useState)({...w,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),addDataset:(0,r.useCallback)(e=>{a(l=>({...l,loadedDatasets:[...l.loadedDatasets,e],error:null}))},[]),removeDataset:(0,r.useCallback)(e=>{a(l=>({...l,loadedDatasets:l.loadedDatasets.filter(c=>c.id!==e)}))},[]),clearAll:(0,r.useCallback)(()=>{a(e=>({...e,loadedDatasets:[]}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),clearError:(0,r.useCallback)(()=>{a(e=>({...e,error:null}))},[]),reset:(0,r.useCallback)(()=>{a({...w,...u})},[u])}}var y={visible:!0,enabled:!1,inspectedFeatures:[],selectedIndex:0,error:null};function Q(u){const[o,a]=(0,r.useState)({...y,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setEnabled:(0,r.useCallback)(e=>{a(l=>({...l,enabled:e}))},[]),enable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!0}))},[]),disable:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!1,inspectedFeatures:[],selectedIndex:0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,enabled:!e.enabled,inspectedFeatures:e.enabled?[]:e.inspectedFeatures,selectedIndex:e.enabled?0:e.selectedIndex}))},[]),setInspectedFeatures:(0,r.useCallback)(e=>{a(l=>({...l,inspectedFeatures:e,selectedIndex:0}))},[]),selectFeature:(0,r.useCallback)(e=>{a(l=>({...l,selectedIndex:Math.max(0,Math.min(e,l.inspectedFeatures.length-1))}))},[]),nextFeature:(0,r.useCallback)(()=>{a(e=>e.inspectedFeatures.length<=1?e:{...e,selectedIndex:(e.selectedIndex+1)%e.inspectedFeatures.length})},[]),previousFeature:(0,r.useCallback)(()=>{a(e=>e.inspectedFeatures.length<=1?e:{...e,selectedIndex:e.selectedIndex===0?e.inspectedFeatures.length-1:e.selectedIndex-1})},[]),clear:(0,r.useCallback)(()=>{a(e=>({...e,inspectedFeatures:[],selectedIndex:0,error:null}))},[]),setError:(0,r.useCallback)(e=>{a(l=>({...l,error:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...y,...u})},[u]),currentFeature:o.inspectedFeatures[o.selectedIndex]||null,featureCount:o.inspectedFeatures.length}}var z={visible:!0,collapsed:!0,center:[0,0],bounds:[0,0,0,0],zoom:0,pitch:0,bearing:0,drawingBBox:!1,drawnBBox:null};function J(u){const[o,a]=(0,r.useState)({...z,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),setDrawingBBox:(0,r.useCallback)(e=>{a(l=>({...l,drawingBBox:e}))},[]),setDrawnBBox:(0,r.useCallback)(e=>{a(l=>({...l,drawnBBox:e}))},[]),clearBBox:(0,r.useCallback)(()=>{a(e=>({...e,drawnBBox:null,drawingBBox:!1}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...z,...u})},[u])}}var E={visible:!0,collapsed:!1,rows:2,columns:2};function K(u){const[o,a]=(0,r.useState)({...E,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setRows:(0,r.useCallback)(e=>{a(l=>({...l,rows:Math.max(1,Math.min(12,Math.round(e)))}))},[]),setColumns:(0,r.useCallback)(e=>{a(l=>({...l,columns:Math.max(1,Math.min(12,Math.round(e)))}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),reset:(0,r.useCallback)(()=>{a({...E,...u})},[u])}}var T={visible:!0,collapsed:!0,url:"",bands:"1",colormap:"viridis",rescaleMin:0,rescaleMax:255,nodata:void 0,layerOpacity:1,pickable:!0,hasLayer:!1,layerCount:0,layers:[],loading:!1,error:null,status:null,layerName:""};function X(u){const[o,a]=(0,r.useState)({...T,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),setUrl:(0,r.useCallback)(e=>{a(l=>({...l,url:e}))},[]),setBands:(0,r.useCallback)(e=>{a(l=>({...l,bands:e}))},[]),setColormap:(0,r.useCallback)(e=>{a(l=>({...l,colormap:e}))},[]),setRescaleMin:(0,r.useCallback)(e=>{a(l=>({...l,rescaleMin:e}))},[]),setRescaleMax:(0,r.useCallback)(e=>{a(l=>({...l,rescaleMax:e}))},[]),setNodata:(0,r.useCallback)(e=>{a(l=>({...l,nodata:e}))},[]),setOpacity:(0,r.useCallback)(e=>{const l=Math.max(0,Math.min(1,e));a(c=>({...c,layerOpacity:l}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggleVisibility:(0,r.useCallback)(()=>{a(e=>({...e,visible:!e.visible}))},[]),togglePanel:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),reset:(0,r.useCallback)(()=>{a({...T,...u})},[u])}}var F={visible:!0,collapsed:!1};function Y(u){const[o,a]=(0,r.useState)({...F,...u});return{state:o,setState:a,setVisible:(0,r.useCallback)(e=>{a(l=>({...l,visible:e}))},[]),setCollapsed:(0,r.useCallback)(e=>{a(l=>({...l,collapsed:e}))},[]),show:(0,r.useCallback)(()=>{a(e=>({...e,visible:!0}))},[]),hide:(0,r.useCallback)(()=>{a(e=>({...e,visible:!1}))},[]),expand:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!1}))},[]),collapse:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!0}))},[]),toggle:(0,r.useCallback)(()=>{a(e=>({...e,collapsed:!e.collapsed}))},[]),reset:(0,r.useCallback)(()=>{a({...F,...u})},[u])}}exports.BasemapReact=S;exports.CogLayerReact=W;exports.ColorbarReact=L;exports.ControlGridReact=I;exports.HtmlControlReact=O;exports.InspectControlReact=D;exports.LegendReact=M;exports.MinimapControlReact=_;exports.SearchControlReact=A;exports.TerrainReact=j;exports.VectorDatasetReact=B;exports.ViewStateControlReact=H;exports.useBasemap=N;exports.useCogLayer=X;exports.useColorbar=G;exports.useControlGrid=K;exports.useHtmlControl=$;exports.useInspectControl=Q;exports.useLegend=U;exports.useMinimapControl=Y;exports.useSearchControl=Z;exports.useTerrain=q;exports.useVectorDataset=P;exports.useViewState=J;
|
package/dist/react.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, M, N as j, ct as B, dt as D, j as H, k as I, lt as W, ot as U, st as _, t as $, ut as G } from "./ControlGrid-
|
|
1
|
+
import { A, M, N as j, ct as B, dt as D, j as H, k as I, lt as W, ot as U, st as _, t as $, ut as G } from "./ControlGrid-kLyx6oLc.js";
|
|
2
2
|
import { useCallback as d, useEffect as f, useRef as h, useState as v } from "react";
|
|
3
3
|
function Z({ map: s, onStateChange: u, position: r = "bottom-right", ...e }) {
|
|
4
4
|
const l = h(null);
|
|
@@ -60,6 +60,7 @@ export declare class PMTilesLayerControl implements IControl {
|
|
|
60
60
|
private _container?;
|
|
61
61
|
private _button?;
|
|
62
62
|
private _panel?;
|
|
63
|
+
private _fetchButton?;
|
|
63
64
|
private _options;
|
|
64
65
|
private _state;
|
|
65
66
|
private _eventHandlers;
|
|
@@ -149,6 +150,13 @@ export declare class PMTilesLayerControl implements IControl {
|
|
|
149
150
|
private _render;
|
|
150
151
|
private _renderCollapsed;
|
|
151
152
|
private _renderExpanded;
|
|
153
|
+
/**
|
|
154
|
+
* Re-evaluates the Fetch button's enabled state from the current URL. Called
|
|
155
|
+
* whenever the URL input changes, including when a sample dataset is picked
|
|
156
|
+
* (which sets the input value programmatically and would not otherwise fire an
|
|
157
|
+
* `input` event), so Fetch enables as soon as there is a URL.
|
|
158
|
+
*/
|
|
159
|
+
private _syncFetchButton;
|
|
152
160
|
/**
|
|
153
161
|
* Re-applies the panel's available-space max-height and any persisted
|
|
154
162
|
* user-chosen size. Safe to call when the panel is collapsed (no-op).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PMTilesLayer.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/PMTilesLayer.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,6BAA6B,CAAC;AAErC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,GAAG,IAAI,WAAW,EAGxB,MAAM,aAAa,CAAC;AAQrB,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EAGzB,MAAM,SAAS,CAAC;AAqCjB;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1D,IAAI,CAAC;AAET;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,C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iB9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAuBvC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IA2BtD;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAK5C;;OAEG;IACH,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO;IAQvC;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAgBvD,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,kBAAkB;IAuF1B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,eAAe;IA+UvB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,aAAa;YAWP,eAAe;YAkBf,kBAAkB;YAkDlB,SAAS;IA6OvB,OAAO,CAAC,YAAY;IA6DpB,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -24,6 +24,7 @@ export declare class ZarrLayerControl implements IControl {
|
|
|
24
24
|
private _container?;
|
|
25
25
|
private _button?;
|
|
26
26
|
private _panel?;
|
|
27
|
+
private _fetchButton?;
|
|
27
28
|
private _options;
|
|
28
29
|
private _state;
|
|
29
30
|
private _eventHandlers;
|
|
@@ -53,6 +54,13 @@ export declare class ZarrLayerControl implements IControl {
|
|
|
53
54
|
* Re-applies the panel's available-space max-height and any persisted
|
|
54
55
|
* user-chosen size. Safe to call when the panel is collapsed (no-op).
|
|
55
56
|
*/
|
|
57
|
+
/**
|
|
58
|
+
* Re-evaluates the Fetch button's enabled state from the current URL. Called
|
|
59
|
+
* whenever the URL input changes, including when a sample dataset is picked
|
|
60
|
+
* (which sets the input value programmatically and would not otherwise fire an
|
|
61
|
+
* `input` event), so Fetch enables as soon as there is a URL.
|
|
62
|
+
*/
|
|
63
|
+
private _syncFetchButton;
|
|
56
64
|
private _reflowPanel;
|
|
57
65
|
getState(): ZarrLayerControlState;
|
|
58
66
|
update(options: Partial<ZarrLayerControlOptions>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZarrLayer.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/ZarrLayer.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC;AAElC,OAAmB,EACjB,KAAK,QAAQ,EACb,KAAK,GAAG,IAAI,WAAW,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EAErB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAiGjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,gBAAiB,YAAW,QAAQ;IAC/C,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,MAAM,CAAC,CAAc;IAC7B,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,cAAc,CACV;IACZ,OAAO,CAAC,IAAI,CAAC,CAAc;IAC3B,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,YAAY,CAAiB;IACrC,8EAA8E;IAC9E,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,iBAAiB,CAAC,CAAa;IAEvC,OAAO,CAAC,WAAW,CAA+B;IAElD,OAAO,CAAC,kBAAkB,CAA+C;IACzE,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC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AM,GAAG,IAAI;IAM/C;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAYvD;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAK5C;;OAEG;IACH,kBAAkB,CAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,aAAa,GAAE,MAAU,GACxB,IAAI;IAQP;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAK3C;;OAEG;IACH,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAIpC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IA0GzC,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,eAAe;IAsXvB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,sBAAsB;YAOhB,SAAS;IAmHvB,OAAO,CAAC,uBAAuB;IAoD/B,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,YAAY;IAyCpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,mBAAmB;CAgB5B"}
|
|
@@ -16,6 +16,7 @@ export declare const PANEL_EDGE_MARGIN = 12;
|
|
|
16
16
|
export declare const PANEL_RESIZE_HANDLE_CLASS = "maplibre-gl-panel-resize-handle";
|
|
17
17
|
export declare const PANEL_RESIZE_LEFT_CLASS = "maplibre-gl-panel-resize-left";
|
|
18
18
|
export declare const PANEL_RESIZE_RIGHT_CLASS = "maplibre-gl-panel-resize-right";
|
|
19
|
+
export declare const PANEL_BODY_CLASS = "maplibre-gl-panel-body";
|
|
19
20
|
/**
|
|
20
21
|
* A persisted, user-chosen panel size from the resize handle.
|
|
21
22
|
*/
|
|
@@ -64,9 +65,10 @@ export interface PanelResizeOptions {
|
|
|
64
65
|
export declare function applyUserPanelSize(opts: PanelResizeOptions): void;
|
|
65
66
|
/**
|
|
66
67
|
* Adds two custom pointer-driven resize grips to a floating panel, one in each
|
|
67
|
-
* bottom corner, matching the UX shipped in `maplibre-gl-vector`. The
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* bottom corner, matching the UX shipped in `maplibre-gl-vector`. The grips are
|
|
69
|
+
* appended to the panel, which is a flex column with a scrolling inner body
|
|
70
|
+
* (see {@link wrapPanelBody}), so they stay pinned to the panel's visible
|
|
71
|
+
* bottom corners while the body scrolls.
|
|
70
72
|
*
|
|
71
73
|
* These panels are flowed children of the MapLibre control container (docked
|
|
72
74
|
* under the toggle button), which keeps the panel anchored at its docked corner.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelResize.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/panelResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,oCAAoC,CAAC;AAC3E,eAAO,MAAM,uBAAuB,kCAAkC,CAAC;AACvE,eAAO,MAAM,wBAAwB,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"panelResize.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/panelResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,gBAAgB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