@feltmaps/js-sdk 1.2.0-next.0 → 1.2.0-next.1
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/client.cjs +1 -1
- package/dist/client.d.cts +18 -3
- package/dist/client.d.ts +18 -3
- package/dist/client.js +1 -1
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +111 -1
- package/dist/handler.d.ts +111 -1
- package/dist/handler.js +1 -1
- package/dist/{types-BHqOjrOq.d.cts → types-BDviYZ-T.d.cts} +111 -2
- package/dist/{types-BHqOjrOq.d.ts → types-BDviYZ-T.d.ts} +111 -2
- package/handler.d.ts +111 -1
- package/handler.js +1 -1
- package/package.json +1 -1
- package/{types-BHqOjrOq.d.ts → types-BDviYZ-T.d.ts} +111 -2
package/dist/client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var M=(e,r)=>{for(var i in r)c(e,i,{get:r[i],enumerable:!0})},G=(e,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!I.call(e,o)&&o!==i&&c(e,o,{get:()=>r[o],enumerable:!(s=V(r,o))||s.enumerable});return e};var b=e=>G(c({},"__esModule",{value:!0}),e);var x={};M(x,{Felt:()=>P});module.exports=b(x);function n(e,r){return({handler:i,options:s})=>{let o=new MessageChannel,a=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:s?{eventName:r,id:a,options:s}:{eventName:r,id:a}},"*",[o.port2]),o.port1.onmessage=l=>{i(l.data)},()=>{o.port1.onmessage=null,o.port1.close(),o.port2.close(),e.postMessage({type:"felt.removeListener",id:a},"*")}}}function t(e,r){return i=>{let s=new MessageChannel;return e.postMessage({type:r,params:i},"*",[s.port2]),new Promise((o,a)=>{s.port1.onmessage=l=>{l.data&&"__error__"in l.data?a(new Error(l.data.__error__)):o(l.data),s.port1.close(),s.port2.close()}})}}var u=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:n(e,"onElementChange"),onElementGroupChange:n(e,"onElementGroupChange")});var C=e=>({onPointerClick:n(e,"onPointerClick"),onPointerMove:n(e,"onPointerMove")});var L=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),onLayerChange:n(e,"onLayerChange"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),onLayerGroupChange:n(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:n(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),getRenderedFeatures:t(e,"getRenderedFeatures")});var h=e=>({onSelectionChange:n(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature")});var E=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi")});var v=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:n(e,"onViewportMove"),onViewportMoveEnd:n(e,"onViewportMoveEnd"),onMapIdle:n(e,"onMapIdle")});function F(e){return{iframe:null,...v(e),...E(e),...L(e),...u(e),...h(e),...C(e)}}var P={embed(e,r,i){let s={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},o={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},a={...s.uiControls,...i?.uiControls},l=i?.origin??s.origin,d=new URL(`${l}/embed/map/${r}`);for(let[m,y]of T(a))y!=null&&d.searchParams.set(o[m],y?"1":"0");if(i?.initialViewport){let m=i.initialViewport;d.searchParams.set("loc",`${m.center.latitude},${m.center.longitude},${m.zoom}z`)}let g=e.tagName==="IFRAME",p=g?e:e.ownerDocument.createElement("iframe");return p.src=d.toString(),g||(p.style.width="100%",p.style.height="100%",p.style.border="none",p.style.margin="0",e.appendChild(p)),p.referrerPolicy="strict-origin-when-cross-origin",new Promise((m,y)=>{p.addEventListener("load",()=>{p.contentWindow==null?y(new Error("Failed to load Felt map")):m(p.contentWindow)},{once:!0})}).then(P.connect).then(m=>(Object.defineProperties(m,{iframe:{value:p,writable:!1,configurable:!1}}),m))},connect(e){let r=F(e);return new Promise((i,s)=>{let o=setTimeout(()=>{s(new Error("Failed to load Felt map")),clearInterval(l)},5e3),a=new MessageChannel,l=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[a.port2])},100);a.port1.onmessage=d=>{d.data===!0&&(clearInterval(l),clearTimeout(o),a.port1.close(),a.port2.close(),i(r))}})}},T=Object.entries;0&&(module.exports={Felt});
|
package/dist/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as Element, G as Geometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, L as Layer, f as GetLayersConstraint, g as LayerChangeCallbackParams, h as LayerGroup, i as GetLayerGroupsConstraint, j as LayerGroupChangeCallbackParams, k as LegendItemIdentifier, l as LegendItem, m as LegendItemsConstraint, n as LegendItemChangeCallbackParams, o as LayerFilters, F as Filters, p as GetRenderedFeaturesConstraint, q as Feature, M as MapInteractionEvent, r as EntityNode, z as zInfer, V as ViewportState,
|
|
2
|
-
export {
|
|
1
|
+
import { E as Element, G as Geometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, L as Layer, f as GetLayersConstraint, g as LayerChangeCallbackParams, h as LayerGroup, i as GetLayerGroupsConstraint, j as LayerGroupChangeCallbackParams, k as LegendItemIdentifier, l as LegendItem, m as LegendItemsConstraint, n as LegendItemChangeCallbackParams, o as LayerFilters, F as Filters, p as GetRenderedFeaturesConstraint, q as Feature, M as MapInteractionEvent, r as EntityNode, s as FeatureSelection, z as zInfer, V as ViewportState, t as SetViewportCenterZoomParams, u as ViewportFitBoundsParams, v as ViewportCenterZoom } from './types-BDviYZ-T.cjs';
|
|
2
|
+
export { B as ElementGroupNode, C as ElementNode, D as FeatureNode, J as FeltBoundary, K as FeltZoom, x as FilterExpression, y as FilterLogicGate, A as FilterTernary, N as LatLng, H as LayerGroupNode, I as LayerNode, w as LayerProcessingStatus, O as LineStringGeometry, P as LngLatTuple, Q as MultiLineStringGeometry, T as MultiPolygonGeometry, U as PointGeometry, W as PolygonGeometry, R as RasterValue } from './types-BDviYZ-T.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -549,6 +549,21 @@ interface SelectionController {
|
|
|
549
549
|
selection: EntityNode[];
|
|
550
550
|
}) => void;
|
|
551
551
|
}): VoidFunction;
|
|
552
|
+
/**
|
|
553
|
+
* Selects a feature on a layer. This will show the feature's popup, modal or
|
|
554
|
+
* sidebar (if configured) and highlight the feature.
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```typescript
|
|
558
|
+
* await felt.selectFeature({
|
|
559
|
+
* id: 123,
|
|
560
|
+
* layerId: "my-layer",
|
|
561
|
+
* showPopup: true,
|
|
562
|
+
* fitViewport: { maxZoom: 15 },
|
|
563
|
+
* });
|
|
564
|
+
* ```
|
|
565
|
+
*/
|
|
566
|
+
selectFeature(params: FeatureSelection): Promise<void>;
|
|
552
567
|
}
|
|
553
568
|
|
|
554
569
|
/**
|
|
@@ -1001,4 +1016,4 @@ declare const Felt: {
|
|
|
1001
1016
|
connect(feltWindow: Window): Promise<FeltController>;
|
|
1002
1017
|
};
|
|
1003
1018
|
|
|
1004
|
-
export { Element, ElementChangeCallbackParams, ElementGroup, ElementGroupChangeCallbackParams, type ElementsController, EntityNode, Feature, Felt, type FeltController, type FeltEmbedOptions, Filters, Geometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerGroupsConstraint, GetLayersConstraint, GetRenderedFeaturesConstraint, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapInteractionEvent, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, type UiController, type UiControlsOptions, ViewportCenterZoom, type ViewportController, ViewportFitBoundsParams, ViewportState };
|
|
1019
|
+
export { Element, ElementChangeCallbackParams, ElementGroup, ElementGroupChangeCallbackParams, type ElementsController, EntityNode, Feature, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, Geometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerGroupsConstraint, GetLayersConstraint, GetRenderedFeaturesConstraint, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapInteractionEvent, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, type UiController, type UiControlsOptions, ViewportCenterZoom, type ViewportController, ViewportFitBoundsParams, ViewportState };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as Element, G as Geometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, L as Layer, f as GetLayersConstraint, g as LayerChangeCallbackParams, h as LayerGroup, i as GetLayerGroupsConstraint, j as LayerGroupChangeCallbackParams, k as LegendItemIdentifier, l as LegendItem, m as LegendItemsConstraint, n as LegendItemChangeCallbackParams, o as LayerFilters, F as Filters, p as GetRenderedFeaturesConstraint, q as Feature, M as MapInteractionEvent, r as EntityNode, z as zInfer, V as ViewportState,
|
|
2
|
-
export {
|
|
1
|
+
import { E as Element, G as Geometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, L as Layer, f as GetLayersConstraint, g as LayerChangeCallbackParams, h as LayerGroup, i as GetLayerGroupsConstraint, j as LayerGroupChangeCallbackParams, k as LegendItemIdentifier, l as LegendItem, m as LegendItemsConstraint, n as LegendItemChangeCallbackParams, o as LayerFilters, F as Filters, p as GetRenderedFeaturesConstraint, q as Feature, M as MapInteractionEvent, r as EntityNode, s as FeatureSelection, z as zInfer, V as ViewportState, t as SetViewportCenterZoomParams, u as ViewportFitBoundsParams, v as ViewportCenterZoom } from './types-BDviYZ-T.js';
|
|
2
|
+
export { B as ElementGroupNode, C as ElementNode, D as FeatureNode, J as FeltBoundary, K as FeltZoom, x as FilterExpression, y as FilterLogicGate, A as FilterTernary, N as LatLng, H as LayerGroupNode, I as LayerNode, w as LayerProcessingStatus, O as LineStringGeometry, P as LngLatTuple, Q as MultiLineStringGeometry, T as MultiPolygonGeometry, U as PointGeometry, W as PolygonGeometry, R as RasterValue } from './types-BDviYZ-T.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -549,6 +549,21 @@ interface SelectionController {
|
|
|
549
549
|
selection: EntityNode[];
|
|
550
550
|
}) => void;
|
|
551
551
|
}): VoidFunction;
|
|
552
|
+
/**
|
|
553
|
+
* Selects a feature on a layer. This will show the feature's popup, modal or
|
|
554
|
+
* sidebar (if configured) and highlight the feature.
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```typescript
|
|
558
|
+
* await felt.selectFeature({
|
|
559
|
+
* id: 123,
|
|
560
|
+
* layerId: "my-layer",
|
|
561
|
+
* showPopup: true,
|
|
562
|
+
* fitViewport: { maxZoom: 15 },
|
|
563
|
+
* });
|
|
564
|
+
* ```
|
|
565
|
+
*/
|
|
566
|
+
selectFeature(params: FeatureSelection): Promise<void>;
|
|
552
567
|
}
|
|
553
568
|
|
|
554
569
|
/**
|
|
@@ -1001,4 +1016,4 @@ declare const Felt: {
|
|
|
1001
1016
|
connect(feltWindow: Window): Promise<FeltController>;
|
|
1002
1017
|
};
|
|
1003
1018
|
|
|
1004
|
-
export { Element, ElementChangeCallbackParams, ElementGroup, ElementGroupChangeCallbackParams, type ElementsController, EntityNode, Feature, Felt, type FeltController, type FeltEmbedOptions, Filters, Geometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerGroupsConstraint, GetLayersConstraint, GetRenderedFeaturesConstraint, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapInteractionEvent, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, type UiController, type UiControlsOptions, ViewportCenterZoom, type ViewportController, ViewportFitBoundsParams, ViewportState };
|
|
1019
|
+
export { Element, ElementChangeCallbackParams, ElementGroup, ElementGroupChangeCallbackParams, type ElementsController, EntityNode, Feature, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, Geometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerGroupsConstraint, GetLayersConstraint, GetRenderedFeaturesConstraint, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapInteractionEvent, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, type UiController, type UiControlsOptions, ViewportCenterZoom, type ViewportController, ViewportFitBoundsParams, ViewportState };
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(e,m){return({handler:l,options:o})=>{let i=new MessageChannel,n=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:o?{eventName:m,id:n,options:o}:{eventName:m,id:n}},"*",[i.port2]),i.port1.onmessage=s=>{l(s.data)},()=>{i.port1.onmessage=null,i.port1.close(),i.port2.close(),e.postMessage({type:"felt.removeListener",id:n},"*")}}}function t(e,m){return l=>{let o=new MessageChannel;return e.postMessage({type:m,params:l},"*",[o.port2]),new Promise((i,n)=>{o.port1.onmessage=s=>{s.data&&"__error__"in s.data?n(new Error(s.data.__error__)):i(s.data),o.port1.close(),o.port2.close()}})}}var g=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementGroupChange:r(e,"onElementGroupChange")});var u=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var C=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),onLayerChange:r(e,"onLayerChange"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),getRenderedFeatures:t(e,"getRenderedFeatures")});var L=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection")});var h=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi")});var E=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function v(e){return{iframe:null,...E(e),...h(e),...C(e),...g(e),...L(e),...u(e)}}var
|
|
1
|
+
function r(e,m){return({handler:l,options:o})=>{let i=new MessageChannel,n=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:o?{eventName:m,id:n,options:o}:{eventName:m,id:n}},"*",[i.port2]),i.port1.onmessage=s=>{l(s.data)},()=>{i.port1.onmessage=null,i.port1.close(),i.port2.close(),e.postMessage({type:"felt.removeListener",id:n},"*")}}}function t(e,m){return l=>{let o=new MessageChannel;return e.postMessage({type:m,params:l},"*",[o.port2]),new Promise((i,n)=>{o.port1.onmessage=s=>{s.data&&"__error__"in s.data?n(new Error(s.data.__error__)):i(s.data),o.port1.close(),o.port2.close()}})}}var g=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementGroupChange:r(e,"onElementGroupChange")});var u=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var C=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),onLayerChange:r(e,"onLayerChange"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),getRenderedFeatures:t(e,"getRenderedFeatures")});var L=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature")});var h=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi")});var E=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function v(e){return{iframe:null,...E(e),...h(e),...C(e),...g(e),...L(e),...u(e)}}var F={embed(e,m,l){let o={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},i={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},n={...o.uiControls,...l?.uiControls},s=l?.origin??o.origin,d=new URL(`${s}/embed/map/${m}`);for(let[p,y]of P(n))y!=null&&d.searchParams.set(i[p],y?"1":"0");if(l?.initialViewport){let p=l.initialViewport;d.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let c=e.tagName==="IFRAME",a=c?e:e.ownerDocument.createElement("iframe");return a.src=d.toString(),c||(a.style.width="100%",a.style.height="100%",a.style.border="none",a.style.margin="0",e.appendChild(a)),a.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,y)=>{a.addEventListener("load",()=>{a.contentWindow==null?y(new Error("Failed to load Felt map")):p(a.contentWindow)},{once:!0})}).then(F.connect).then(p=>(Object.defineProperties(p,{iframe:{value:a,writable:!1,configurable:!1}}),p))},connect(e){let m=v(e);return new Promise((l,o)=>{let i=setTimeout(()=>{o(new Error("Failed to load Felt map")),clearInterval(s)},5e3),n=new MessageChannel,s=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[n.port2])},100);n.port1.onmessage=d=>{d.data===!0&&(clearInterval(s),clearTimeout(i),n.port1.close(),n.port2.close(),l(m))}})}},P=Object.entries;export{F as Felt};
|
package/dist/handler.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var z=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(e,r)=>{for(var f in r)z(e,f,{get:r[f],enumerable:!0})},ce=(e,r,f,L)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of le(r))!pe.call(e,u)&&u!==f&&z(e,u,{get:()=>r[u],enumerable:!(L=ie(r,u))||L.enumerable});return e};var ye=e=>ce(z({},"__esModule",{value:!0}),e);var it={};me(it,{createMessageHandler:()=>et});module.exports=ye(it);var i=require("zod");var g=require("zod");var c=require("zod");function t(e,r){return c.z.strictObject({type:c.z.literal(e),params:r})}function h(e,r){return c.z.strictObject({eventName:c.z.literal(e),id:c.z.string(),options:r})}function y(e){return c.z.strictObject({eventName:c.z.literal(e),id:c.z.string()})}var p=require("zod"),v=p.z.number(),V=p.z.number(),I=p.z.object({latitude:V,longitude:v}),j=p.z.number().min(1).max(23),x=p.z.tuple([v,V,v,V]),G=p.z.object({show:p.z.array(p.z.string()).optional(),hide:p.z.array(p.z.string()).optional()});var S=require("zod"),k=S.z.object({ids:S.z.array(S.z.string()).optional()}),N=S.z.object({ids:S.z.array(S.z.string()).optional()});var de=t("getElement",g.z.string()),ue=t("getElementGeometry",g.z.string()),ge=t("getElements",k.optional()),fe=t("getElementGroup",g.z.string()),he=t("getElementGroups",N.optional()),Se=t("setElementGroupVisibility",G),Le=h("onElementChange",g.z.object({id:g.z.string()})),Me=h("onElementGroupChange",g.z.object({id:g.z.string()})),R={methods:[de,ue,ge,fe,he,Se],listeners:[Le,Me]};var be=y("onPointerClick"),Ge=y("onPointerMove"),U={methods:null,listeners:[be,Ge]};var s=require("zod");var o=require("zod"),Ie=o.z.enum(["in","ni"]),xe=o.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Lt=o.z.enum(["and","or"]),B=o.z.union([o.z.number(),o.z.string(),o.z.boolean(),o.z.null()]),Z=o.z.string().or(o.z.null()),Fe=o.z.tuple([Z,Ie,o.z.array(B).or(o.z.null())]),Ce=o.z.tuple([Z,xe,B]),P=o.z.union([Fe,Ce]),w=o.z.tuple([o.z.lazy(()=>o.z.union([w,P,o.z.null(),o.z.boolean()])),o.z.enum(["and","or"]),o.z.lazy(()=>o.z.union([w,P,o.z.null(),o.z.boolean()]))]),A=o.z.union([w,P,o.z.null(),o.z.boolean()]);var n=require("zod");var Gt=n.z.enum(["processing","completed","failed","incomplete"]),q=n.z.object({ids:n.z.array(n.z.string()).optional()}),H=n.z.object({ids:n.z.array(n.z.string()).optional()}),M=n.z.object({id:n.z.string(),layerId:n.z.string()}),_=n.z.object({ids:M.array().optional(),layerIds:n.z.string().array().optional()}),W=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:I}),n.z.object({boundary:x})]).optional()});var Ee=t("getLayer",s.z.string()),ze=t("getLayers",q.optional()),ve=t("setLayerVisibility",G),Ve=h("onLayerChange",s.z.object({id:s.z.string()})),Pe=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),we=t("getLayerGroup",s.z.string()),Oe=t("getLayerGroups",H.optional()),Te=t("setLayerGroupVisibility",G),je=h("onLayerGroupChange",s.z.object({id:s.z.string()})),ke=t("getLegendItem",M),Ne=t("getLegendItems",_.optional()),Re=h("onLegendItemChange",M),Ue=t("setLegendItemVisibility",s.z.object({show:M.array().optional(),hide:M.array().optional()})),Be=t("getLayerFilters",s.z.string()),Ze=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:A})),Ae=t("getRenderedFeatures",W.optional()),Q={methods:[Ee,ze,ve,Pe,we,Oe,Te,ke,Ne,Ue,Be,Ze,Ae],listeners:[Ve,je,Re]};var J=require("zod");var d=require("zod"),D=d.z.object({id:d.z.string().or(d.z.number()),layerId:d.z.string(),showPopup:d.z.boolean().optional(),fitViewport:d.z.boolean().or(d.z.object({maxZoom:d.z.number()})).optional()});var qe=t("getSelection",J.z.undefined()),He=y("onSelectionChange"),_e=t("selectFeature",D),K={methods:[qe,_e],listeners:[He]};var a=require("zod"),X=a.z.object({showLegend:a.z.boolean().optional(),cooperativeGestures:a.z.boolean().optional(),fullScreenButton:a.z.boolean().optional(),geolocation:a.z.boolean().optional(),zoomControls:a.z.boolean().optional(),scaleBar:a.z.boolean().optional()}),Y=a.z.object({featureSelectPanel:a.z.boolean().optional(),featureHoverPanel:a.z.boolean().optional(),elementSelectPanel:a.z.boolean().optional(),linkClickOpen:a.z.boolean().optional(),imageLightboxOpen:a.z.boolean().optional()});var We=t("updateUiControls",X),Qe=t("setOnMapInteractionsUi",Y),$={methods:[We,Qe],listeners:null};var ne=require("zod");var F=require("zod");var ee=F.z.object({center:I,zoom:j}),te=F.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),oe=F.z.object({bounds:x});var De=t("getViewport",ne.z.undefined()),Je=t("setViewport",te),Ke=t("fitViewportToBounds",oe),Xe=y("onViewportMove"),Ye=y("onViewportMoveEnd"),$e=y("onMapIdle"),re={methods:[Je,De,Ke],listeners:[Xe,Ye,$e]};var O=[$,re,Q,R,K,U];function et(e,r,f){let L=new Map;async function u(m){if(!at.safeParse(m.data).success){f?.onUnknownMessage?.(m.data);return}let T=ae.safeParse(m.data);if(!T.success){f?.onInvalidMessage?.(m.data);return}let{data:l}=T;if(l.type==="felt.ready")m.ports[0]?.postMessage(!0);else if(l.type==="felt.addListener"){if(l.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let b="options"in l.event?{options:"options"in l.event?l.event.options:void 0,handler:E=>{m.ports[0]?.postMessage(E)}}:{handler:E=>{m.ports[0]?.postMessage(E)}},C=r.listeners[l.event.eventName](b);L.set(l.event.id,C)}else if(l.type==="felt.removeListener")L.get(l.id)?.(),L.delete(l.id);else try{let b=r.methods[l.type],C=await b(l.params);m.ports[0]?.postMessage(C)}catch(b){m.ports[0]?.postMessage({__error__:tt(b)})}}return e.addEventListener("message",u),()=>{e.removeEventListener("message",u)}}function tt(e){return e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Unknown error"}var se={methods:O.map(e=>e.methods??[]).flat(),listeners:O.map(e=>e.listeners??[]).flat()},ot=i.z.discriminatedUnion("eventName",[i.z.strictObject({eventName:i.z.literal("")}),...se.listeners]),nt=i.z.strictObject({type:i.z.literal("felt.addListener"),event:ot}),rt=i.z.strictObject({type:i.z.literal("felt.removeListener"),id:i.z.string()}),st=i.z.strictObject({type:i.z.literal("felt.ready")}),ae=i.z.discriminatedUnion("type",[st,nt,rt,...se.methods]),at=i.z.object({type:i.z.enum(ae.options.map(e=>e.shape.type.value))});0&&(module.exports={createMessageHandler});
|
package/dist/handler.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams,
|
|
3
|
+
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams, A as FilterTernary, r as EntityNode, V as ViewportState, X as UnionToIntersection, Y as PromiseOrNot } from './types-BDviYZ-T.cjs';
|
|
4
4
|
|
|
5
5
|
type Method<TRequest extends {
|
|
6
6
|
type: string;
|
|
@@ -572,20 +572,80 @@ declare const GetRenderedFeaturesMessage: z.ZodObject<{
|
|
|
572
572
|
type: z.ZodLiteral<"getRenderedFeatures">;
|
|
573
573
|
params: z.ZodOptional<z.ZodObject<{
|
|
574
574
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
575
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
576
|
+
coordinates: z.ZodObject<{
|
|
577
|
+
latitude: z.ZodNumber;
|
|
578
|
+
longitude: z.ZodNumber;
|
|
579
|
+
}, "strip", z.ZodTypeAny, {
|
|
580
|
+
latitude: number;
|
|
581
|
+
longitude: number;
|
|
582
|
+
}, {
|
|
583
|
+
latitude: number;
|
|
584
|
+
longitude: number;
|
|
585
|
+
}>;
|
|
586
|
+
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
coordinates: {
|
|
588
|
+
latitude: number;
|
|
589
|
+
longitude: number;
|
|
590
|
+
};
|
|
591
|
+
}, {
|
|
592
|
+
coordinates: {
|
|
593
|
+
latitude: number;
|
|
594
|
+
longitude: number;
|
|
595
|
+
};
|
|
596
|
+
}>, z.ZodObject<{
|
|
597
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
boundary: [number, number, number, number];
|
|
600
|
+
}, {
|
|
601
|
+
boundary: [number, number, number, number];
|
|
602
|
+
}>]>>;
|
|
575
603
|
}, "strip", z.ZodTypeAny, {
|
|
576
604
|
layerIds?: string[] | undefined;
|
|
605
|
+
areaQuery?: {
|
|
606
|
+
coordinates: {
|
|
607
|
+
latitude: number;
|
|
608
|
+
longitude: number;
|
|
609
|
+
};
|
|
610
|
+
} | {
|
|
611
|
+
boundary: [number, number, number, number];
|
|
612
|
+
} | undefined;
|
|
577
613
|
}, {
|
|
578
614
|
layerIds?: string[] | undefined;
|
|
615
|
+
areaQuery?: {
|
|
616
|
+
coordinates: {
|
|
617
|
+
latitude: number;
|
|
618
|
+
longitude: number;
|
|
619
|
+
};
|
|
620
|
+
} | {
|
|
621
|
+
boundary: [number, number, number, number];
|
|
622
|
+
} | undefined;
|
|
579
623
|
}>>;
|
|
580
624
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
581
625
|
type: "getRenderedFeatures";
|
|
582
626
|
params?: {
|
|
583
627
|
layerIds?: string[] | undefined;
|
|
628
|
+
areaQuery?: {
|
|
629
|
+
coordinates: {
|
|
630
|
+
latitude: number;
|
|
631
|
+
longitude: number;
|
|
632
|
+
};
|
|
633
|
+
} | {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
} | undefined;
|
|
584
636
|
} | undefined;
|
|
585
637
|
}, {
|
|
586
638
|
type: "getRenderedFeatures";
|
|
587
639
|
params?: {
|
|
588
640
|
layerIds?: string[] | undefined;
|
|
641
|
+
areaQuery?: {
|
|
642
|
+
coordinates: {
|
|
643
|
+
latitude: number;
|
|
644
|
+
longitude: number;
|
|
645
|
+
};
|
|
646
|
+
} | {
|
|
647
|
+
boundary: [number, number, number, number];
|
|
648
|
+
} | undefined;
|
|
589
649
|
} | undefined;
|
|
590
650
|
}>;
|
|
591
651
|
type LayersSchema = {
|
|
@@ -621,9 +681,59 @@ declare const GetSelectionMessage: z.ZodObject<{
|
|
|
621
681
|
type: "getSelection";
|
|
622
682
|
params?: undefined;
|
|
623
683
|
}>;
|
|
684
|
+
declare const SelectFeatureMessage: z.ZodObject<{
|
|
685
|
+
type: z.ZodLiteral<"selectFeature">;
|
|
686
|
+
params: z.ZodObject<{
|
|
687
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
688
|
+
layerId: z.ZodString;
|
|
689
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
691
|
+
maxZoom: z.ZodNumber;
|
|
692
|
+
}, "strip", z.ZodTypeAny, {
|
|
693
|
+
maxZoom: number;
|
|
694
|
+
}, {
|
|
695
|
+
maxZoom: number;
|
|
696
|
+
}>]>>;
|
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
|
698
|
+
id: string | number;
|
|
699
|
+
layerId: string;
|
|
700
|
+
showPopup?: boolean | undefined;
|
|
701
|
+
fitViewport?: boolean | {
|
|
702
|
+
maxZoom: number;
|
|
703
|
+
} | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
id: string | number;
|
|
706
|
+
layerId: string;
|
|
707
|
+
showPopup?: boolean | undefined;
|
|
708
|
+
fitViewport?: boolean | {
|
|
709
|
+
maxZoom: number;
|
|
710
|
+
} | undefined;
|
|
711
|
+
}>;
|
|
712
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
713
|
+
params: {
|
|
714
|
+
id: string | number;
|
|
715
|
+
layerId: string;
|
|
716
|
+
showPopup?: boolean | undefined;
|
|
717
|
+
fitViewport?: boolean | {
|
|
718
|
+
maxZoom: number;
|
|
719
|
+
} | undefined;
|
|
720
|
+
};
|
|
721
|
+
type: "selectFeature";
|
|
722
|
+
}, {
|
|
723
|
+
params: {
|
|
724
|
+
id: string | number;
|
|
725
|
+
layerId: string;
|
|
726
|
+
showPopup?: boolean | undefined;
|
|
727
|
+
fitViewport?: boolean | {
|
|
728
|
+
maxZoom: number;
|
|
729
|
+
} | undefined;
|
|
730
|
+
};
|
|
731
|
+
type: "selectFeature";
|
|
732
|
+
}>;
|
|
624
733
|
type SelectionSchema = {
|
|
625
734
|
methods: {
|
|
626
735
|
getSelection: Method<zInfer<typeof GetSelectionMessage>, Array<EntityNode>>;
|
|
736
|
+
selectFeature: Method<zInfer<typeof SelectFeatureMessage>, void>;
|
|
627
737
|
};
|
|
628
738
|
listeners: {
|
|
629
739
|
onSelectionChange: Listener<void, {
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams,
|
|
3
|
+
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams, A as FilterTernary, r as EntityNode, V as ViewportState, X as UnionToIntersection, Y as PromiseOrNot } from './types-BDviYZ-T.js';
|
|
4
4
|
|
|
5
5
|
type Method<TRequest extends {
|
|
6
6
|
type: string;
|
|
@@ -572,20 +572,80 @@ declare const GetRenderedFeaturesMessage: z.ZodObject<{
|
|
|
572
572
|
type: z.ZodLiteral<"getRenderedFeatures">;
|
|
573
573
|
params: z.ZodOptional<z.ZodObject<{
|
|
574
574
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
575
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
576
|
+
coordinates: z.ZodObject<{
|
|
577
|
+
latitude: z.ZodNumber;
|
|
578
|
+
longitude: z.ZodNumber;
|
|
579
|
+
}, "strip", z.ZodTypeAny, {
|
|
580
|
+
latitude: number;
|
|
581
|
+
longitude: number;
|
|
582
|
+
}, {
|
|
583
|
+
latitude: number;
|
|
584
|
+
longitude: number;
|
|
585
|
+
}>;
|
|
586
|
+
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
coordinates: {
|
|
588
|
+
latitude: number;
|
|
589
|
+
longitude: number;
|
|
590
|
+
};
|
|
591
|
+
}, {
|
|
592
|
+
coordinates: {
|
|
593
|
+
latitude: number;
|
|
594
|
+
longitude: number;
|
|
595
|
+
};
|
|
596
|
+
}>, z.ZodObject<{
|
|
597
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
boundary: [number, number, number, number];
|
|
600
|
+
}, {
|
|
601
|
+
boundary: [number, number, number, number];
|
|
602
|
+
}>]>>;
|
|
575
603
|
}, "strip", z.ZodTypeAny, {
|
|
576
604
|
layerIds?: string[] | undefined;
|
|
605
|
+
areaQuery?: {
|
|
606
|
+
coordinates: {
|
|
607
|
+
latitude: number;
|
|
608
|
+
longitude: number;
|
|
609
|
+
};
|
|
610
|
+
} | {
|
|
611
|
+
boundary: [number, number, number, number];
|
|
612
|
+
} | undefined;
|
|
577
613
|
}, {
|
|
578
614
|
layerIds?: string[] | undefined;
|
|
615
|
+
areaQuery?: {
|
|
616
|
+
coordinates: {
|
|
617
|
+
latitude: number;
|
|
618
|
+
longitude: number;
|
|
619
|
+
};
|
|
620
|
+
} | {
|
|
621
|
+
boundary: [number, number, number, number];
|
|
622
|
+
} | undefined;
|
|
579
623
|
}>>;
|
|
580
624
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
581
625
|
type: "getRenderedFeatures";
|
|
582
626
|
params?: {
|
|
583
627
|
layerIds?: string[] | undefined;
|
|
628
|
+
areaQuery?: {
|
|
629
|
+
coordinates: {
|
|
630
|
+
latitude: number;
|
|
631
|
+
longitude: number;
|
|
632
|
+
};
|
|
633
|
+
} | {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
} | undefined;
|
|
584
636
|
} | undefined;
|
|
585
637
|
}, {
|
|
586
638
|
type: "getRenderedFeatures";
|
|
587
639
|
params?: {
|
|
588
640
|
layerIds?: string[] | undefined;
|
|
641
|
+
areaQuery?: {
|
|
642
|
+
coordinates: {
|
|
643
|
+
latitude: number;
|
|
644
|
+
longitude: number;
|
|
645
|
+
};
|
|
646
|
+
} | {
|
|
647
|
+
boundary: [number, number, number, number];
|
|
648
|
+
} | undefined;
|
|
589
649
|
} | undefined;
|
|
590
650
|
}>;
|
|
591
651
|
type LayersSchema = {
|
|
@@ -621,9 +681,59 @@ declare const GetSelectionMessage: z.ZodObject<{
|
|
|
621
681
|
type: "getSelection";
|
|
622
682
|
params?: undefined;
|
|
623
683
|
}>;
|
|
684
|
+
declare const SelectFeatureMessage: z.ZodObject<{
|
|
685
|
+
type: z.ZodLiteral<"selectFeature">;
|
|
686
|
+
params: z.ZodObject<{
|
|
687
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
688
|
+
layerId: z.ZodString;
|
|
689
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
691
|
+
maxZoom: z.ZodNumber;
|
|
692
|
+
}, "strip", z.ZodTypeAny, {
|
|
693
|
+
maxZoom: number;
|
|
694
|
+
}, {
|
|
695
|
+
maxZoom: number;
|
|
696
|
+
}>]>>;
|
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
|
698
|
+
id: string | number;
|
|
699
|
+
layerId: string;
|
|
700
|
+
showPopup?: boolean | undefined;
|
|
701
|
+
fitViewport?: boolean | {
|
|
702
|
+
maxZoom: number;
|
|
703
|
+
} | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
id: string | number;
|
|
706
|
+
layerId: string;
|
|
707
|
+
showPopup?: boolean | undefined;
|
|
708
|
+
fitViewport?: boolean | {
|
|
709
|
+
maxZoom: number;
|
|
710
|
+
} | undefined;
|
|
711
|
+
}>;
|
|
712
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
713
|
+
params: {
|
|
714
|
+
id: string | number;
|
|
715
|
+
layerId: string;
|
|
716
|
+
showPopup?: boolean | undefined;
|
|
717
|
+
fitViewport?: boolean | {
|
|
718
|
+
maxZoom: number;
|
|
719
|
+
} | undefined;
|
|
720
|
+
};
|
|
721
|
+
type: "selectFeature";
|
|
722
|
+
}, {
|
|
723
|
+
params: {
|
|
724
|
+
id: string | number;
|
|
725
|
+
layerId: string;
|
|
726
|
+
showPopup?: boolean | undefined;
|
|
727
|
+
fitViewport?: boolean | {
|
|
728
|
+
maxZoom: number;
|
|
729
|
+
} | undefined;
|
|
730
|
+
};
|
|
731
|
+
type: "selectFeature";
|
|
732
|
+
}>;
|
|
624
733
|
type SelectionSchema = {
|
|
625
734
|
methods: {
|
|
626
735
|
getSelection: Method<zInfer<typeof GetSelectionMessage>, Array<EntityNode>>;
|
|
736
|
+
selectFeature: Method<zInfer<typeof SelectFeatureMessage>, void>;
|
|
627
737
|
};
|
|
628
738
|
listeners: {
|
|
629
739
|
onSelectionChange: Listener<void, {
|
package/dist/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as i}from"zod";import{z as
|
|
1
|
+
import{z as i}from"zod";import{z as u}from"zod";import{z as c}from"zod";function e(o,g){return c.strictObject({type:c.literal(o),params:g})}function d(o,g){return c.strictObject({eventName:c.literal(o),id:c.string(),options:g})}function m(o){return c.strictObject({eventName:c.literal(o),id:c.string()})}import{z as l}from"zod";var F=l.number(),C=l.number(),M=l.object({latitude:C,longitude:F}),T=l.number().min(1).max(23),b=l.tuple([F,C,F,C]),L=l.object({show:l.array(l.string()).optional(),hide:l.array(l.string()).optional()});import{z as f}from"zod";var j=f.object({ids:f.array(f.string()).optional()}),k=f.object({ids:f.array(f.string()).optional()});var re=e("getElement",u.string()),se=e("getElementGeometry",u.string()),ae=e("getElements",j.optional()),ie=e("getElementGroup",u.string()),le=e("getElementGroups",k.optional()),pe=e("setElementGroupVisibility",L),me=d("onElementChange",u.object({id:u.string()})),ce=d("onElementGroupChange",u.object({id:u.string()})),N={methods:[re,se,ae,ie,le,pe],listeners:[me,ce]};var ye=m("onPointerClick"),de=m("onPointerMove"),R={methods:null,listeners:[ye,de]};import{z as s}from"zod";import{z as t}from"zod";var ue=t.enum(["in","ni"]),ge=t.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),ut=t.enum(["and","or"]),U=t.union([t.number(),t.string(),t.boolean(),t.null()]),B=t.string().or(t.null()),fe=t.tuple([B,ue,t.array(U).or(t.null())]),he=t.tuple([B,ge,U]),E=t.union([fe,he]),z=t.tuple([t.lazy(()=>t.union([z,E,t.null(),t.boolean()])),t.enum(["and","or"]),t.lazy(()=>t.union([z,E,t.null(),t.boolean()]))]),Z=t.union([z,E,t.null(),t.boolean()]);import{z as n}from"zod";var St=n.enum(["processing","completed","failed","incomplete"]),A=n.object({ids:n.array(n.string()).optional()}),q=n.object({ids:n.array(n.string()).optional()}),h=n.object({id:n.string(),layerId:n.string()}),H=n.object({ids:h.array().optional(),layerIds:n.string().array().optional()}),_=n.object({layerIds:n.array(n.string()).optional(),areaQuery:n.union([n.object({coordinates:M}),n.object({boundary:b})]).optional()});var Se=e("getLayer",s.string()),Le=e("getLayers",A.optional()),Me=e("setLayerVisibility",L),be=d("onLayerChange",s.object({id:s.string()})),Ge=e("setLayerStyle",s.object({id:s.string(),style:s.object({}).passthrough()})),Ie=e("getLayerGroup",s.string()),xe=e("getLayerGroups",q.optional()),Fe=e("setLayerGroupVisibility",L),Ce=d("onLayerGroupChange",s.object({id:s.string()})),Ee=e("getLegendItem",h),ze=e("getLegendItems",H.optional()),ve=d("onLegendItemChange",h),Ve=e("setLegendItemVisibility",s.object({show:h.array().optional(),hide:h.array().optional()})),Pe=e("getLayerFilters",s.string()),we=e("setLayerFilters",s.object({layerId:s.string(),filters:Z})),Oe=e("getRenderedFeatures",_.optional()),W={methods:[Se,Le,Me,Ge,Ie,xe,Fe,Ee,ze,Ve,Pe,we,Oe],listeners:[be,Ce,ve]};import{z as Te}from"zod";import{z as y}from"zod";var Q=y.object({id:y.string().or(y.number()),layerId:y.string(),showPopup:y.boolean().optional(),fitViewport:y.boolean().or(y.object({maxZoom:y.number()})).optional()});var je=e("getSelection",Te.undefined()),ke=m("onSelectionChange"),Ne=e("selectFeature",Q),D={methods:[je,Ne],listeners:[ke]};import{z as a}from"zod";var J=a.object({showLegend:a.boolean().optional(),cooperativeGestures:a.boolean().optional(),fullScreenButton:a.boolean().optional(),geolocation:a.boolean().optional(),zoomControls:a.boolean().optional(),scaleBar:a.boolean().optional()}),K=a.object({featureSelectPanel:a.boolean().optional(),featureHoverPanel:a.boolean().optional(),elementSelectPanel:a.boolean().optional(),linkClickOpen:a.boolean().optional(),imageLightboxOpen:a.boolean().optional()});var Re=e("updateUiControls",J),Ue=e("setOnMapInteractionsUi",K),X={methods:[Re,Ue],listeners:null};import{z as Be}from"zod";import{z as v}from"zod";var Y=v.object({center:M,zoom:T}),$=v.object({center:Y.shape.center.optional(),zoom:Y.shape.zoom.optional()}),ee=v.object({bounds:b});var Ze=e("getViewport",Be.undefined()),Ae=e("setViewport",$),qe=e("fitViewportToBounds",ee),He=m("onViewportMove"),_e=m("onViewportMoveEnd"),We=m("onMapIdle"),te={methods:[Ae,Ze,qe],listeners:[He,_e,We]};var V=[X,te,W,N,D,R];function $t(o,g,P){let G=new Map;async function w(p){if(!Ye.safeParse(p.data).success){P?.onUnknownMessage?.(p.data);return}let O=ne.safeParse(p.data);if(!O.success){P?.onInvalidMessage?.(p.data);return}let{data:r}=O;if(r.type==="felt.ready")p.ports[0]?.postMessage(!0);else if(r.type==="felt.addListener"){if(r.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let S="options"in r.event?{options:"options"in r.event?r.event.options:void 0,handler:x=>{p.ports[0]?.postMessage(x)}}:{handler:x=>{p.ports[0]?.postMessage(x)}},I=g.listeners[r.event.eventName](S);G.set(r.event.id,I)}else if(r.type==="felt.removeListener")G.get(r.id)?.(),G.delete(r.id);else try{let S=g.methods[r.type],I=await S(r.params);p.ports[0]?.postMessage(I)}catch(S){p.ports[0]?.postMessage({__error__:Qe(S)})}}return o.addEventListener("message",w),()=>{o.removeEventListener("message",w)}}function Qe(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}var oe={methods:V.map(o=>o.methods??[]).flat(),listeners:V.map(o=>o.listeners??[]).flat()},De=i.discriminatedUnion("eventName",[i.strictObject({eventName:i.literal("")}),...oe.listeners]),Je=i.strictObject({type:i.literal("felt.addListener"),event:De}),Ke=i.strictObject({type:i.literal("felt.removeListener"),id:i.string()}),Xe=i.strictObject({type:i.literal("felt.ready")}),ne=i.discriminatedUnion("type",[Xe,Je,Ke,...oe.methods]),Ye=i.object({type:i.enum(ne.options.map(o=>o.shape.type.value))});export{$t as createMessageHandler};
|
|
@@ -584,12 +584,20 @@ interface LegendItemChangeCallbackParams {
|
|
|
584
584
|
legendItem: LegendItem | null;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
|
-
* Constraints for the `getRenderedFeatures` method. If no constraints are
|
|
587
|
+
* Constraints for the `getRenderedFeatures` method. This can include layer constriants, spatial constraints, or both. If no constraints are
|
|
588
588
|
* provided, all rendered features will be returned.
|
|
589
589
|
*
|
|
590
590
|
* @group Layers
|
|
591
591
|
*/
|
|
592
592
|
interface GetRenderedFeaturesConstraint extends zInfer<typeof GetRenderedFeaturesConstraintSchema> {
|
|
593
|
+
/**
|
|
594
|
+
* The area to query for rendered features. This can be specific coordinates or a {@link FeltBoundary}. If omitted, the entire viewport will be queried.
|
|
595
|
+
*/
|
|
596
|
+
areaQuery?: {
|
|
597
|
+
coordinates: LatLng;
|
|
598
|
+
} | {
|
|
599
|
+
boundary: FeltBoundary;
|
|
600
|
+
};
|
|
593
601
|
}
|
|
594
602
|
/** @ignore */
|
|
595
603
|
declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
@@ -597,10 +605,54 @@ declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
|
597
605
|
* The ids of the layers to get rendered features for.
|
|
598
606
|
*/
|
|
599
607
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
608
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
609
|
+
coordinates: z.ZodObject<{
|
|
610
|
+
latitude: z.ZodNumber;
|
|
611
|
+
longitude: z.ZodNumber;
|
|
612
|
+
}, "strip", z.ZodTypeAny, {
|
|
613
|
+
latitude: number;
|
|
614
|
+
longitude: number;
|
|
615
|
+
}, {
|
|
616
|
+
latitude: number;
|
|
617
|
+
longitude: number;
|
|
618
|
+
}>;
|
|
619
|
+
}, "strip", z.ZodTypeAny, {
|
|
620
|
+
coordinates: {
|
|
621
|
+
latitude: number;
|
|
622
|
+
longitude: number;
|
|
623
|
+
};
|
|
624
|
+
}, {
|
|
625
|
+
coordinates: {
|
|
626
|
+
latitude: number;
|
|
627
|
+
longitude: number;
|
|
628
|
+
};
|
|
629
|
+
}>, z.ZodObject<{
|
|
630
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
boundary: [number, number, number, number];
|
|
633
|
+
}, {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
}>]>>;
|
|
600
636
|
}, "strip", z.ZodTypeAny, {
|
|
601
637
|
layerIds?: string[] | undefined;
|
|
638
|
+
areaQuery?: {
|
|
639
|
+
coordinates: {
|
|
640
|
+
latitude: number;
|
|
641
|
+
longitude: number;
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
644
|
+
boundary: [number, number, number, number];
|
|
645
|
+
} | undefined;
|
|
602
646
|
}, {
|
|
603
647
|
layerIds?: string[] | undefined;
|
|
648
|
+
areaQuery?: {
|
|
649
|
+
coordinates: {
|
|
650
|
+
latitude: number;
|
|
651
|
+
longitude: number;
|
|
652
|
+
};
|
|
653
|
+
} | {
|
|
654
|
+
boundary: [number, number, number, number];
|
|
655
|
+
} | undefined;
|
|
604
656
|
}>;
|
|
605
657
|
|
|
606
658
|
/**
|
|
@@ -770,6 +822,63 @@ type FeatureNode = {
|
|
|
770
822
|
type: "feature";
|
|
771
823
|
entity: Feature;
|
|
772
824
|
};
|
|
825
|
+
/**
|
|
826
|
+
* The options for selecting a feature in a layer.
|
|
827
|
+
*/
|
|
828
|
+
interface FeatureSelection extends zInfer<typeof FeatureSelectionSchema> {
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @ignore
|
|
832
|
+
*/
|
|
833
|
+
declare const FeatureSelectionSchema: z.ZodObject<{
|
|
834
|
+
/**
|
|
835
|
+
* The id of the feature to select.
|
|
836
|
+
*/
|
|
837
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
838
|
+
/**
|
|
839
|
+
* The id of the layer that the feature belongs to.
|
|
840
|
+
*/
|
|
841
|
+
layerId: z.ZodString;
|
|
842
|
+
/**
|
|
843
|
+
* Whether to show the feature's popup, if it is configured in the layer's style.
|
|
844
|
+
*
|
|
845
|
+
* @default true
|
|
846
|
+
*/
|
|
847
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
848
|
+
/**
|
|
849
|
+
* Whether to center the view on the feature after selecting it.
|
|
850
|
+
*
|
|
851
|
+
* When true, the viewport will be centered on the feature and zoomed to fit the feature
|
|
852
|
+
* in the viewport. If you need to control the zoom level to prevent it zooming in too
|
|
853
|
+
* far, you can pass an object with a `maxZoom` property.
|
|
854
|
+
*
|
|
855
|
+
* This is useful for avoiding zooming in too far on point features, or if you want
|
|
856
|
+
* to maintain the current zoom level.
|
|
857
|
+
*
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
860
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
861
|
+
maxZoom: z.ZodNumber;
|
|
862
|
+
}, "strip", z.ZodTypeAny, {
|
|
863
|
+
maxZoom: number;
|
|
864
|
+
}, {
|
|
865
|
+
maxZoom: number;
|
|
866
|
+
}>]>>;
|
|
867
|
+
}, "strip", z.ZodTypeAny, {
|
|
868
|
+
id: string | number;
|
|
869
|
+
layerId: string;
|
|
870
|
+
showPopup?: boolean | undefined;
|
|
871
|
+
fitViewport?: boolean | {
|
|
872
|
+
maxZoom: number;
|
|
873
|
+
} | undefined;
|
|
874
|
+
}, {
|
|
875
|
+
id: string | number;
|
|
876
|
+
layerId: string;
|
|
877
|
+
showPopup?: boolean | undefined;
|
|
878
|
+
fitViewport?: boolean | {
|
|
879
|
+
maxZoom: number;
|
|
880
|
+
} | undefined;
|
|
881
|
+
}>;
|
|
773
882
|
|
|
774
883
|
/**
|
|
775
884
|
* The input type for setting the viewport to a particular center and zoom.
|
|
@@ -892,4 +1001,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
892
1001
|
bounds: [number, number, number, number];
|
|
893
1002
|
}>;
|
|
894
1003
|
|
|
895
|
-
export type {
|
|
1004
|
+
export type { FilterTernary as A, ElementGroupNode as B, ElementNode as C, FeatureNode as D, Element as E, Filters as F, Geometry as G, LayerGroupNode as H, LayerNode as I, FeltBoundary as J, FeltZoom as K, Layer as L, MapInteractionEvent as M, LatLng as N, LineStringGeometry as O, LngLatTuple as P, MultiLineStringGeometry as Q, RasterValue as R, SetVisibilityRequest as S, MultiPolygonGeometry as T, PointGeometry as U, ViewportState as V, PolygonGeometry as W, UnionToIntersection as X, PromiseOrNot as Y, GetElementsConstraint as a, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, GetLayersConstraint as f, LayerChangeCallbackParams as g, LayerGroup as h, GetLayerGroupsConstraint as i, LayerGroupChangeCallbackParams as j, LegendItemIdentifier as k, LegendItem as l, LegendItemsConstraint as m, LegendItemChangeCallbackParams as n, LayerFilters as o, GetRenderedFeaturesConstraint as p, Feature as q, EntityNode as r, FeatureSelection as s, SetViewportCenterZoomParams as t, ViewportFitBoundsParams as u, ViewportCenterZoom as v, LayerProcessingStatus as w, FilterExpression as x, FilterLogicGate as y, zInfer as z };
|
|
@@ -584,12 +584,20 @@ interface LegendItemChangeCallbackParams {
|
|
|
584
584
|
legendItem: LegendItem | null;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
|
-
* Constraints for the `getRenderedFeatures` method. If no constraints are
|
|
587
|
+
* Constraints for the `getRenderedFeatures` method. This can include layer constriants, spatial constraints, or both. If no constraints are
|
|
588
588
|
* provided, all rendered features will be returned.
|
|
589
589
|
*
|
|
590
590
|
* @group Layers
|
|
591
591
|
*/
|
|
592
592
|
interface GetRenderedFeaturesConstraint extends zInfer<typeof GetRenderedFeaturesConstraintSchema> {
|
|
593
|
+
/**
|
|
594
|
+
* The area to query for rendered features. This can be specific coordinates or a {@link FeltBoundary}. If omitted, the entire viewport will be queried.
|
|
595
|
+
*/
|
|
596
|
+
areaQuery?: {
|
|
597
|
+
coordinates: LatLng;
|
|
598
|
+
} | {
|
|
599
|
+
boundary: FeltBoundary;
|
|
600
|
+
};
|
|
593
601
|
}
|
|
594
602
|
/** @ignore */
|
|
595
603
|
declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
@@ -597,10 +605,54 @@ declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
|
597
605
|
* The ids of the layers to get rendered features for.
|
|
598
606
|
*/
|
|
599
607
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
608
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
609
|
+
coordinates: z.ZodObject<{
|
|
610
|
+
latitude: z.ZodNumber;
|
|
611
|
+
longitude: z.ZodNumber;
|
|
612
|
+
}, "strip", z.ZodTypeAny, {
|
|
613
|
+
latitude: number;
|
|
614
|
+
longitude: number;
|
|
615
|
+
}, {
|
|
616
|
+
latitude: number;
|
|
617
|
+
longitude: number;
|
|
618
|
+
}>;
|
|
619
|
+
}, "strip", z.ZodTypeAny, {
|
|
620
|
+
coordinates: {
|
|
621
|
+
latitude: number;
|
|
622
|
+
longitude: number;
|
|
623
|
+
};
|
|
624
|
+
}, {
|
|
625
|
+
coordinates: {
|
|
626
|
+
latitude: number;
|
|
627
|
+
longitude: number;
|
|
628
|
+
};
|
|
629
|
+
}>, z.ZodObject<{
|
|
630
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
boundary: [number, number, number, number];
|
|
633
|
+
}, {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
}>]>>;
|
|
600
636
|
}, "strip", z.ZodTypeAny, {
|
|
601
637
|
layerIds?: string[] | undefined;
|
|
638
|
+
areaQuery?: {
|
|
639
|
+
coordinates: {
|
|
640
|
+
latitude: number;
|
|
641
|
+
longitude: number;
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
644
|
+
boundary: [number, number, number, number];
|
|
645
|
+
} | undefined;
|
|
602
646
|
}, {
|
|
603
647
|
layerIds?: string[] | undefined;
|
|
648
|
+
areaQuery?: {
|
|
649
|
+
coordinates: {
|
|
650
|
+
latitude: number;
|
|
651
|
+
longitude: number;
|
|
652
|
+
};
|
|
653
|
+
} | {
|
|
654
|
+
boundary: [number, number, number, number];
|
|
655
|
+
} | undefined;
|
|
604
656
|
}>;
|
|
605
657
|
|
|
606
658
|
/**
|
|
@@ -770,6 +822,63 @@ type FeatureNode = {
|
|
|
770
822
|
type: "feature";
|
|
771
823
|
entity: Feature;
|
|
772
824
|
};
|
|
825
|
+
/**
|
|
826
|
+
* The options for selecting a feature in a layer.
|
|
827
|
+
*/
|
|
828
|
+
interface FeatureSelection extends zInfer<typeof FeatureSelectionSchema> {
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @ignore
|
|
832
|
+
*/
|
|
833
|
+
declare const FeatureSelectionSchema: z.ZodObject<{
|
|
834
|
+
/**
|
|
835
|
+
* The id of the feature to select.
|
|
836
|
+
*/
|
|
837
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
838
|
+
/**
|
|
839
|
+
* The id of the layer that the feature belongs to.
|
|
840
|
+
*/
|
|
841
|
+
layerId: z.ZodString;
|
|
842
|
+
/**
|
|
843
|
+
* Whether to show the feature's popup, if it is configured in the layer's style.
|
|
844
|
+
*
|
|
845
|
+
* @default true
|
|
846
|
+
*/
|
|
847
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
848
|
+
/**
|
|
849
|
+
* Whether to center the view on the feature after selecting it.
|
|
850
|
+
*
|
|
851
|
+
* When true, the viewport will be centered on the feature and zoomed to fit the feature
|
|
852
|
+
* in the viewport. If you need to control the zoom level to prevent it zooming in too
|
|
853
|
+
* far, you can pass an object with a `maxZoom` property.
|
|
854
|
+
*
|
|
855
|
+
* This is useful for avoiding zooming in too far on point features, or if you want
|
|
856
|
+
* to maintain the current zoom level.
|
|
857
|
+
*
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
860
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
861
|
+
maxZoom: z.ZodNumber;
|
|
862
|
+
}, "strip", z.ZodTypeAny, {
|
|
863
|
+
maxZoom: number;
|
|
864
|
+
}, {
|
|
865
|
+
maxZoom: number;
|
|
866
|
+
}>]>>;
|
|
867
|
+
}, "strip", z.ZodTypeAny, {
|
|
868
|
+
id: string | number;
|
|
869
|
+
layerId: string;
|
|
870
|
+
showPopup?: boolean | undefined;
|
|
871
|
+
fitViewport?: boolean | {
|
|
872
|
+
maxZoom: number;
|
|
873
|
+
} | undefined;
|
|
874
|
+
}, {
|
|
875
|
+
id: string | number;
|
|
876
|
+
layerId: string;
|
|
877
|
+
showPopup?: boolean | undefined;
|
|
878
|
+
fitViewport?: boolean | {
|
|
879
|
+
maxZoom: number;
|
|
880
|
+
} | undefined;
|
|
881
|
+
}>;
|
|
773
882
|
|
|
774
883
|
/**
|
|
775
884
|
* The input type for setting the viewport to a particular center and zoom.
|
|
@@ -892,4 +1001,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
892
1001
|
bounds: [number, number, number, number];
|
|
893
1002
|
}>;
|
|
894
1003
|
|
|
895
|
-
export type {
|
|
1004
|
+
export type { FilterTernary as A, ElementGroupNode as B, ElementNode as C, FeatureNode as D, Element as E, Filters as F, Geometry as G, LayerGroupNode as H, LayerNode as I, FeltBoundary as J, FeltZoom as K, Layer as L, MapInteractionEvent as M, LatLng as N, LineStringGeometry as O, LngLatTuple as P, MultiLineStringGeometry as Q, RasterValue as R, SetVisibilityRequest as S, MultiPolygonGeometry as T, PointGeometry as U, ViewportState as V, PolygonGeometry as W, UnionToIntersection as X, PromiseOrNot as Y, GetElementsConstraint as a, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, GetLayersConstraint as f, LayerChangeCallbackParams as g, LayerGroup as h, GetLayerGroupsConstraint as i, LayerGroupChangeCallbackParams as j, LegendItemIdentifier as k, LegendItem as l, LegendItemsConstraint as m, LegendItemChangeCallbackParams as n, LayerFilters as o, GetRenderedFeaturesConstraint as p, Feature as q, EntityNode as r, FeatureSelection as s, SetViewportCenterZoomParams as t, ViewportFitBoundsParams as u, ViewportCenterZoom as v, LayerProcessingStatus as w, FilterExpression as x, FilterLogicGate as y, zInfer as z };
|
package/handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams,
|
|
3
|
+
import { z as zInfer, E as Element, G as Geometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, h as LayerGroup, l as LegendItem, o as LayerFilters, q as Feature, g as LayerChangeCallbackParams, j as LayerGroupChangeCallbackParams, n as LegendItemChangeCallbackParams, A as FilterTernary, r as EntityNode, V as ViewportState, X as UnionToIntersection, Y as PromiseOrNot } from './types-BDviYZ-T.js';
|
|
4
4
|
|
|
5
5
|
type Method<TRequest extends {
|
|
6
6
|
type: string;
|
|
@@ -572,20 +572,80 @@ declare const GetRenderedFeaturesMessage: z.ZodObject<{
|
|
|
572
572
|
type: z.ZodLiteral<"getRenderedFeatures">;
|
|
573
573
|
params: z.ZodOptional<z.ZodObject<{
|
|
574
574
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
575
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
576
|
+
coordinates: z.ZodObject<{
|
|
577
|
+
latitude: z.ZodNumber;
|
|
578
|
+
longitude: z.ZodNumber;
|
|
579
|
+
}, "strip", z.ZodTypeAny, {
|
|
580
|
+
latitude: number;
|
|
581
|
+
longitude: number;
|
|
582
|
+
}, {
|
|
583
|
+
latitude: number;
|
|
584
|
+
longitude: number;
|
|
585
|
+
}>;
|
|
586
|
+
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
coordinates: {
|
|
588
|
+
latitude: number;
|
|
589
|
+
longitude: number;
|
|
590
|
+
};
|
|
591
|
+
}, {
|
|
592
|
+
coordinates: {
|
|
593
|
+
latitude: number;
|
|
594
|
+
longitude: number;
|
|
595
|
+
};
|
|
596
|
+
}>, z.ZodObject<{
|
|
597
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
boundary: [number, number, number, number];
|
|
600
|
+
}, {
|
|
601
|
+
boundary: [number, number, number, number];
|
|
602
|
+
}>]>>;
|
|
575
603
|
}, "strip", z.ZodTypeAny, {
|
|
576
604
|
layerIds?: string[] | undefined;
|
|
605
|
+
areaQuery?: {
|
|
606
|
+
coordinates: {
|
|
607
|
+
latitude: number;
|
|
608
|
+
longitude: number;
|
|
609
|
+
};
|
|
610
|
+
} | {
|
|
611
|
+
boundary: [number, number, number, number];
|
|
612
|
+
} | undefined;
|
|
577
613
|
}, {
|
|
578
614
|
layerIds?: string[] | undefined;
|
|
615
|
+
areaQuery?: {
|
|
616
|
+
coordinates: {
|
|
617
|
+
latitude: number;
|
|
618
|
+
longitude: number;
|
|
619
|
+
};
|
|
620
|
+
} | {
|
|
621
|
+
boundary: [number, number, number, number];
|
|
622
|
+
} | undefined;
|
|
579
623
|
}>>;
|
|
580
624
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
581
625
|
type: "getRenderedFeatures";
|
|
582
626
|
params?: {
|
|
583
627
|
layerIds?: string[] | undefined;
|
|
628
|
+
areaQuery?: {
|
|
629
|
+
coordinates: {
|
|
630
|
+
latitude: number;
|
|
631
|
+
longitude: number;
|
|
632
|
+
};
|
|
633
|
+
} | {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
} | undefined;
|
|
584
636
|
} | undefined;
|
|
585
637
|
}, {
|
|
586
638
|
type: "getRenderedFeatures";
|
|
587
639
|
params?: {
|
|
588
640
|
layerIds?: string[] | undefined;
|
|
641
|
+
areaQuery?: {
|
|
642
|
+
coordinates: {
|
|
643
|
+
latitude: number;
|
|
644
|
+
longitude: number;
|
|
645
|
+
};
|
|
646
|
+
} | {
|
|
647
|
+
boundary: [number, number, number, number];
|
|
648
|
+
} | undefined;
|
|
589
649
|
} | undefined;
|
|
590
650
|
}>;
|
|
591
651
|
type LayersSchema = {
|
|
@@ -621,9 +681,59 @@ declare const GetSelectionMessage: z.ZodObject<{
|
|
|
621
681
|
type: "getSelection";
|
|
622
682
|
params?: undefined;
|
|
623
683
|
}>;
|
|
684
|
+
declare const SelectFeatureMessage: z.ZodObject<{
|
|
685
|
+
type: z.ZodLiteral<"selectFeature">;
|
|
686
|
+
params: z.ZodObject<{
|
|
687
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
688
|
+
layerId: z.ZodString;
|
|
689
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
691
|
+
maxZoom: z.ZodNumber;
|
|
692
|
+
}, "strip", z.ZodTypeAny, {
|
|
693
|
+
maxZoom: number;
|
|
694
|
+
}, {
|
|
695
|
+
maxZoom: number;
|
|
696
|
+
}>]>>;
|
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
|
698
|
+
id: string | number;
|
|
699
|
+
layerId: string;
|
|
700
|
+
showPopup?: boolean | undefined;
|
|
701
|
+
fitViewport?: boolean | {
|
|
702
|
+
maxZoom: number;
|
|
703
|
+
} | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
id: string | number;
|
|
706
|
+
layerId: string;
|
|
707
|
+
showPopup?: boolean | undefined;
|
|
708
|
+
fitViewport?: boolean | {
|
|
709
|
+
maxZoom: number;
|
|
710
|
+
} | undefined;
|
|
711
|
+
}>;
|
|
712
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
713
|
+
params: {
|
|
714
|
+
id: string | number;
|
|
715
|
+
layerId: string;
|
|
716
|
+
showPopup?: boolean | undefined;
|
|
717
|
+
fitViewport?: boolean | {
|
|
718
|
+
maxZoom: number;
|
|
719
|
+
} | undefined;
|
|
720
|
+
};
|
|
721
|
+
type: "selectFeature";
|
|
722
|
+
}, {
|
|
723
|
+
params: {
|
|
724
|
+
id: string | number;
|
|
725
|
+
layerId: string;
|
|
726
|
+
showPopup?: boolean | undefined;
|
|
727
|
+
fitViewport?: boolean | {
|
|
728
|
+
maxZoom: number;
|
|
729
|
+
} | undefined;
|
|
730
|
+
};
|
|
731
|
+
type: "selectFeature";
|
|
732
|
+
}>;
|
|
624
733
|
type SelectionSchema = {
|
|
625
734
|
methods: {
|
|
626
735
|
getSelection: Method<zInfer<typeof GetSelectionMessage>, Array<EntityNode>>;
|
|
736
|
+
selectFeature: Method<zInfer<typeof SelectFeatureMessage>, void>;
|
|
627
737
|
};
|
|
628
738
|
listeners: {
|
|
629
739
|
onSelectionChange: Listener<void, {
|
package/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var z=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(e,r)=>{for(var f in r)z(e,f,{get:r[f],enumerable:!0})},ce=(e,r,f,L)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of le(r))!pe.call(e,u)&&u!==f&&z(e,u,{get:()=>r[u],enumerable:!(L=ie(r,u))||L.enumerable});return e};var ye=e=>ce(z({},"__esModule",{value:!0}),e);var it={};me(it,{createMessageHandler:()=>et});module.exports=ye(it);var i=require("zod");var g=require("zod");var c=require("zod");function t(e,r){return c.z.strictObject({type:c.z.literal(e),params:r})}function h(e,r){return c.z.strictObject({eventName:c.z.literal(e),id:c.z.string(),options:r})}function y(e){return c.z.strictObject({eventName:c.z.literal(e),id:c.z.string()})}var p=require("zod"),v=p.z.number(),V=p.z.number(),I=p.z.object({latitude:V,longitude:v}),j=p.z.number().min(1).max(23),x=p.z.tuple([v,V,v,V]),G=p.z.object({show:p.z.array(p.z.string()).optional(),hide:p.z.array(p.z.string()).optional()});var S=require("zod"),k=S.z.object({ids:S.z.array(S.z.string()).optional()}),N=S.z.object({ids:S.z.array(S.z.string()).optional()});var de=t("getElement",g.z.string()),ue=t("getElementGeometry",g.z.string()),ge=t("getElements",k.optional()),fe=t("getElementGroup",g.z.string()),he=t("getElementGroups",N.optional()),Se=t("setElementGroupVisibility",G),Le=h("onElementChange",g.z.object({id:g.z.string()})),Me=h("onElementGroupChange",g.z.object({id:g.z.string()})),R={methods:[de,ue,ge,fe,he,Se],listeners:[Le,Me]};var be=y("onPointerClick"),Ge=y("onPointerMove"),U={methods:null,listeners:[be,Ge]};var s=require("zod");var o=require("zod"),Ie=o.z.enum(["in","ni"]),xe=o.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Lt=o.z.enum(["and","or"]),B=o.z.union([o.z.number(),o.z.string(),o.z.boolean(),o.z.null()]),Z=o.z.string().or(o.z.null()),Fe=o.z.tuple([Z,Ie,o.z.array(B).or(o.z.null())]),Ce=o.z.tuple([Z,xe,B]),P=o.z.union([Fe,Ce]),w=o.z.tuple([o.z.lazy(()=>o.z.union([w,P,o.z.null(),o.z.boolean()])),o.z.enum(["and","or"]),o.z.lazy(()=>o.z.union([w,P,o.z.null(),o.z.boolean()]))]),A=o.z.union([w,P,o.z.null(),o.z.boolean()]);var n=require("zod");var Gt=n.z.enum(["processing","completed","failed","incomplete"]),q=n.z.object({ids:n.z.array(n.z.string()).optional()}),H=n.z.object({ids:n.z.array(n.z.string()).optional()}),M=n.z.object({id:n.z.string(),layerId:n.z.string()}),_=n.z.object({ids:M.array().optional(),layerIds:n.z.string().array().optional()}),W=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:I}),n.z.object({boundary:x})]).optional()});var Ee=t("getLayer",s.z.string()),ze=t("getLayers",q.optional()),ve=t("setLayerVisibility",G),Ve=h("onLayerChange",s.z.object({id:s.z.string()})),Pe=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),we=t("getLayerGroup",s.z.string()),Oe=t("getLayerGroups",H.optional()),Te=t("setLayerGroupVisibility",G),je=h("onLayerGroupChange",s.z.object({id:s.z.string()})),ke=t("getLegendItem",M),Ne=t("getLegendItems",_.optional()),Re=h("onLegendItemChange",M),Ue=t("setLegendItemVisibility",s.z.object({show:M.array().optional(),hide:M.array().optional()})),Be=t("getLayerFilters",s.z.string()),Ze=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:A})),Ae=t("getRenderedFeatures",W.optional()),Q={methods:[Ee,ze,ve,Pe,we,Oe,Te,ke,Ne,Ue,Be,Ze,Ae],listeners:[Ve,je,Re]};var J=require("zod");var d=require("zod"),D=d.z.object({id:d.z.string().or(d.z.number()),layerId:d.z.string(),showPopup:d.z.boolean().optional(),fitViewport:d.z.boolean().or(d.z.object({maxZoom:d.z.number()})).optional()});var qe=t("getSelection",J.z.undefined()),He=y("onSelectionChange"),_e=t("selectFeature",D),K={methods:[qe,_e],listeners:[He]};var a=require("zod"),X=a.z.object({showLegend:a.z.boolean().optional(),cooperativeGestures:a.z.boolean().optional(),fullScreenButton:a.z.boolean().optional(),geolocation:a.z.boolean().optional(),zoomControls:a.z.boolean().optional(),scaleBar:a.z.boolean().optional()}),Y=a.z.object({featureSelectPanel:a.z.boolean().optional(),featureHoverPanel:a.z.boolean().optional(),elementSelectPanel:a.z.boolean().optional(),linkClickOpen:a.z.boolean().optional(),imageLightboxOpen:a.z.boolean().optional()});var We=t("updateUiControls",X),Qe=t("setOnMapInteractionsUi",Y),$={methods:[We,Qe],listeners:null};var ne=require("zod");var F=require("zod");var ee=F.z.object({center:I,zoom:j}),te=F.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),oe=F.z.object({bounds:x});var De=t("getViewport",ne.z.undefined()),Je=t("setViewport",te),Ke=t("fitViewportToBounds",oe),Xe=y("onViewportMove"),Ye=y("onViewportMoveEnd"),$e=y("onMapIdle"),re={methods:[Je,De,Ke],listeners:[Xe,Ye,$e]};var O=[$,re,Q,R,K,U];function et(e,r,f){let L=new Map;async function u(m){if(!at.safeParse(m.data).success){f?.onUnknownMessage?.(m.data);return}let T=ae.safeParse(m.data);if(!T.success){f?.onInvalidMessage?.(m.data);return}let{data:l}=T;if(l.type==="felt.ready")m.ports[0]?.postMessage(!0);else if(l.type==="felt.addListener"){if(l.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let b="options"in l.event?{options:"options"in l.event?l.event.options:void 0,handler:E=>{m.ports[0]?.postMessage(E)}}:{handler:E=>{m.ports[0]?.postMessage(E)}},C=r.listeners[l.event.eventName](b);L.set(l.event.id,C)}else if(l.type==="felt.removeListener")L.get(l.id)?.(),L.delete(l.id);else try{let b=r.methods[l.type],C=await b(l.params);m.ports[0]?.postMessage(C)}catch(b){m.ports[0]?.postMessage({__error__:tt(b)})}}return e.addEventListener("message",u),()=>{e.removeEventListener("message",u)}}function tt(e){return e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Unknown error"}var se={methods:O.map(e=>e.methods??[]).flat(),listeners:O.map(e=>e.listeners??[]).flat()},ot=i.z.discriminatedUnion("eventName",[i.z.strictObject({eventName:i.z.literal("")}),...se.listeners]),nt=i.z.strictObject({type:i.z.literal("felt.addListener"),event:ot}),rt=i.z.strictObject({type:i.z.literal("felt.removeListener"),id:i.z.string()}),st=i.z.strictObject({type:i.z.literal("felt.ready")}),ae=i.z.discriminatedUnion("type",[st,nt,rt,...se.methods]),at=i.z.object({type:i.z.enum(ae.options.map(e=>e.shape.type.value))});0&&(module.exports={createMessageHandler});
|
package/package.json
CHANGED
|
@@ -584,12 +584,20 @@ interface LegendItemChangeCallbackParams {
|
|
|
584
584
|
legendItem: LegendItem | null;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
|
-
* Constraints for the `getRenderedFeatures` method. If no constraints are
|
|
587
|
+
* Constraints for the `getRenderedFeatures` method. This can include layer constriants, spatial constraints, or both. If no constraints are
|
|
588
588
|
* provided, all rendered features will be returned.
|
|
589
589
|
*
|
|
590
590
|
* @group Layers
|
|
591
591
|
*/
|
|
592
592
|
interface GetRenderedFeaturesConstraint extends zInfer<typeof GetRenderedFeaturesConstraintSchema> {
|
|
593
|
+
/**
|
|
594
|
+
* The area to query for rendered features. This can be specific coordinates or a {@link FeltBoundary}. If omitted, the entire viewport will be queried.
|
|
595
|
+
*/
|
|
596
|
+
areaQuery?: {
|
|
597
|
+
coordinates: LatLng;
|
|
598
|
+
} | {
|
|
599
|
+
boundary: FeltBoundary;
|
|
600
|
+
};
|
|
593
601
|
}
|
|
594
602
|
/** @ignore */
|
|
595
603
|
declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
@@ -597,10 +605,54 @@ declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
|
|
|
597
605
|
* The ids of the layers to get rendered features for.
|
|
598
606
|
*/
|
|
599
607
|
layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
608
|
+
areaQuery: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
609
|
+
coordinates: z.ZodObject<{
|
|
610
|
+
latitude: z.ZodNumber;
|
|
611
|
+
longitude: z.ZodNumber;
|
|
612
|
+
}, "strip", z.ZodTypeAny, {
|
|
613
|
+
latitude: number;
|
|
614
|
+
longitude: number;
|
|
615
|
+
}, {
|
|
616
|
+
latitude: number;
|
|
617
|
+
longitude: number;
|
|
618
|
+
}>;
|
|
619
|
+
}, "strip", z.ZodTypeAny, {
|
|
620
|
+
coordinates: {
|
|
621
|
+
latitude: number;
|
|
622
|
+
longitude: number;
|
|
623
|
+
};
|
|
624
|
+
}, {
|
|
625
|
+
coordinates: {
|
|
626
|
+
latitude: number;
|
|
627
|
+
longitude: number;
|
|
628
|
+
};
|
|
629
|
+
}>, z.ZodObject<{
|
|
630
|
+
boundary: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
boundary: [number, number, number, number];
|
|
633
|
+
}, {
|
|
634
|
+
boundary: [number, number, number, number];
|
|
635
|
+
}>]>>;
|
|
600
636
|
}, "strip", z.ZodTypeAny, {
|
|
601
637
|
layerIds?: string[] | undefined;
|
|
638
|
+
areaQuery?: {
|
|
639
|
+
coordinates: {
|
|
640
|
+
latitude: number;
|
|
641
|
+
longitude: number;
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
644
|
+
boundary: [number, number, number, number];
|
|
645
|
+
} | undefined;
|
|
602
646
|
}, {
|
|
603
647
|
layerIds?: string[] | undefined;
|
|
648
|
+
areaQuery?: {
|
|
649
|
+
coordinates: {
|
|
650
|
+
latitude: number;
|
|
651
|
+
longitude: number;
|
|
652
|
+
};
|
|
653
|
+
} | {
|
|
654
|
+
boundary: [number, number, number, number];
|
|
655
|
+
} | undefined;
|
|
604
656
|
}>;
|
|
605
657
|
|
|
606
658
|
/**
|
|
@@ -770,6 +822,63 @@ type FeatureNode = {
|
|
|
770
822
|
type: "feature";
|
|
771
823
|
entity: Feature;
|
|
772
824
|
};
|
|
825
|
+
/**
|
|
826
|
+
* The options for selecting a feature in a layer.
|
|
827
|
+
*/
|
|
828
|
+
interface FeatureSelection extends zInfer<typeof FeatureSelectionSchema> {
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @ignore
|
|
832
|
+
*/
|
|
833
|
+
declare const FeatureSelectionSchema: z.ZodObject<{
|
|
834
|
+
/**
|
|
835
|
+
* The id of the feature to select.
|
|
836
|
+
*/
|
|
837
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
838
|
+
/**
|
|
839
|
+
* The id of the layer that the feature belongs to.
|
|
840
|
+
*/
|
|
841
|
+
layerId: z.ZodString;
|
|
842
|
+
/**
|
|
843
|
+
* Whether to show the feature's popup, if it is configured in the layer's style.
|
|
844
|
+
*
|
|
845
|
+
* @default true
|
|
846
|
+
*/
|
|
847
|
+
showPopup: z.ZodOptional<z.ZodBoolean>;
|
|
848
|
+
/**
|
|
849
|
+
* Whether to center the view on the feature after selecting it.
|
|
850
|
+
*
|
|
851
|
+
* When true, the viewport will be centered on the feature and zoomed to fit the feature
|
|
852
|
+
* in the viewport. If you need to control the zoom level to prevent it zooming in too
|
|
853
|
+
* far, you can pass an object with a `maxZoom` property.
|
|
854
|
+
*
|
|
855
|
+
* This is useful for avoiding zooming in too far on point features, or if you want
|
|
856
|
+
* to maintain the current zoom level.
|
|
857
|
+
*
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
860
|
+
fitViewport: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
861
|
+
maxZoom: z.ZodNumber;
|
|
862
|
+
}, "strip", z.ZodTypeAny, {
|
|
863
|
+
maxZoom: number;
|
|
864
|
+
}, {
|
|
865
|
+
maxZoom: number;
|
|
866
|
+
}>]>>;
|
|
867
|
+
}, "strip", z.ZodTypeAny, {
|
|
868
|
+
id: string | number;
|
|
869
|
+
layerId: string;
|
|
870
|
+
showPopup?: boolean | undefined;
|
|
871
|
+
fitViewport?: boolean | {
|
|
872
|
+
maxZoom: number;
|
|
873
|
+
} | undefined;
|
|
874
|
+
}, {
|
|
875
|
+
id: string | number;
|
|
876
|
+
layerId: string;
|
|
877
|
+
showPopup?: boolean | undefined;
|
|
878
|
+
fitViewport?: boolean | {
|
|
879
|
+
maxZoom: number;
|
|
880
|
+
} | undefined;
|
|
881
|
+
}>;
|
|
773
882
|
|
|
774
883
|
/**
|
|
775
884
|
* The input type for setting the viewport to a particular center and zoom.
|
|
@@ -892,4 +1001,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
892
1001
|
bounds: [number, number, number, number];
|
|
893
1002
|
}>;
|
|
894
1003
|
|
|
895
|
-
export type {
|
|
1004
|
+
export type { FilterTernary as A, ElementGroupNode as B, ElementNode as C, FeatureNode as D, Element as E, Filters as F, Geometry as G, LayerGroupNode as H, LayerNode as I, FeltBoundary as J, FeltZoom as K, Layer as L, MapInteractionEvent as M, LatLng as N, LineStringGeometry as O, LngLatTuple as P, MultiLineStringGeometry as Q, RasterValue as R, SetVisibilityRequest as S, MultiPolygonGeometry as T, PointGeometry as U, ViewportState as V, PolygonGeometry as W, UnionToIntersection as X, PromiseOrNot as Y, GetElementsConstraint as a, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, GetLayersConstraint as f, LayerChangeCallbackParams as g, LayerGroup as h, GetLayerGroupsConstraint as i, LayerGroupChangeCallbackParams as j, LegendItemIdentifier as k, LegendItem as l, LegendItemsConstraint as m, LegendItemChangeCallbackParams as n, LayerFilters as o, GetRenderedFeaturesConstraint as p, Feature as q, EntityNode as r, FeatureSelection as s, SetViewportCenterZoomParams as t, ViewportFitBoundsParams as u, ViewportCenterZoom as v, LayerProcessingStatus as w, FilterExpression as x, FilterLogicGate as y, zInfer as z };
|