@feltmaps/js-sdk 1.10.2-next.0 → 1.11.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +12 -2
- package/dist/client.d.ts +12 -2
- package/dist/client.js +1 -1
- package/dist/controller-bundled.d.ts +779 -3
- package/dist/{controller-DXsOpGmy.d.cts → controller-m5hIgJCz.d.cts} +779 -3
- package/dist/{controller-DXsOpGmy.d.ts → controller-m5hIgJCz.d.ts} +779 -3
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +504 -1
- package/dist/handler.d.ts +504 -1
- package/dist/handler.js +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var y=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var K=(e,o)=>{for(var r in o)y(e,r,{get:o[r],enumerable:!0})},O=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of R(o))!B.call(e,i)&&i!==r&&y(e,i,{get:()=>o[i],enumerable:!(a=k(o,i))||a.enumerable});return e};var D=e=>O(y({},"__esModule",{value:!0}),e);var j={};K(j,{Felt:()=>U});module.exports=D(j);function P(e,o){for(let[r,a]of Object.entries(e))switch(typeof a){case"object":switch(!0){case Array.isArray(a):for(let i of a)P(i,o);break;case a===null:o(r,a,e);break;default:P(a,o);break}break;default:o(r,a,e);break}}function H(e){return e[0]?.toUpperCase()===e[0]}function J(e){return e.startsWith("on")&&H(e.slice(2))}function C(e,o){typeof e=="object"&&e!==null&&P(e,(r,a,i)=>{J(r)&&o(r,a,i)})}function n(e,o){return r=>{let a=new MessageChannel,i=r.handler,m="options"in r?r.options:void 0,u=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:m?{eventName:o,id:u,options:m}:{eventName:o,id:u}},"*",[a.port2]),a.port1.onmessage=p=>{E(p)||i(p.data)},()=>{a.port1.onmessage=null,a.port1.close(),a.port2.close(),e.postMessage({type:"felt.removeListener",id:u},"*")}}}function t(e,o,r){return async a=>{let i=new MessageChannel,m=a&&r?await r(a):a;return e.postMessage({type:o,params:m},"*",[i.port2]),new Promise((u,p)=>{i.port1.onmessage=g=>{E(g)?p(new Error(g.data.__error__)):u(g.data),i.port1.close(),i.port2.close()}})}}var T={};function d(e,o){let r=t(e,o),a=n(e,"onGenericEvent");return async i=>{let m=[];C(i,(g,s,l)=>{if(typeof s!="function")return;let c=crypto.randomUUID();l[g]=c,T[c]=s;let L=a({handler:h=>{switch(h){case`felt.removeGenericListener:${c}`:L();break;default:s(h)}},options:{id:c}});m.push(L)});let p=await r(i);return typeof p=="object"&&p!==null&&C(p,(g,s,l)=>{if(typeof s!="string")return;let c=T[s];c&&(l[g]=c)}),p}}function E(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var v=e=>({getCurrentBasemap:t(e,"getCurrentBasemap"),getBasemaps:t(e,"getBasemaps"),chooseBasemap:t(e,"chooseBasemap"),addCustomBasemap:t(e,"addCustomBasemap"),removeBasemap:t(e,"removeBasemap"),onBasemapChange:n(e,"onBasemapChange")});var F=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"),onElementCreate:n(e,"onElementCreate"),onElementCreateEnd:n(e,"onElementCreateEnd"),onElementDelete:n(e,"onElementDelete"),onElementGroupChange:n(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var G=e=>({onPointerClick:n(e,"onPointerClick"),onPointerMove:n(e,"onPointerMove")});var I=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:n(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",b),updateLayer:t(e,"updateLayer",b),deleteLayer:t(e,"deleteLayer"),duplicateLayer:t(e,"duplicateLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),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"),onLayerFiltersChange:n(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:n(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getPrecomputedAggregates:t(e,"getPrecomputedAggregates"),getRasterAggregates:t(e,"getRasterAggregates"),getRasterHistogramData:t(e,"getRasterHistogramData"),getRasterCategoryData:t(e,"getRasterCategoryData"),getRasterProfile:t(e,"getRasterProfile"),getLayerSchema:t(e,"getLayerSchema")});async function b(e){let{source:o}=e;return o&&o.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await o.file.text())}}:e}var M=e=>({getMapDetails:t(e,"getMapDetails")});var V=e=>({onSelectionChange:n(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var S=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:n(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:n(e,"onToolSettingsChange")});var A=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable"),createPanelId:t(e,"createPanelId"),createOrUpdatePanel:d(e,"createOrUpdatePanel"),deletePanel:t(e,"deletePanel"),createPanelElements:d(e,"createPanelElements"),updatePanelElements:d(e,"updatePanelElements"),deletePanelElements:t(e,"deletePanelElements"),createActionTrigger:d(e,"createActionTrigger"),updateActionTrigger:d(e,"updateActionTrigger"),deleteActionTrigger:t(e,"deleteActionTrigger"),createFeatureAction:d(e,"createFeatureAction"),updateFeatureAction:d(e,"updateFeatureAction"),deleteFeatureAction:t(e,"deleteFeatureAction")});var f=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:n(e,"onViewportMove"),onViewportMoveEnd:n(e,"onViewportMoveEnd"),onMapIdle:n(e,"onMapIdle")});function x(e){return{iframe:null,...f(e),...A(e),...I(e),...F(e),...V(e),...G(e),...S(e),...M(e),...v(e)}}var U={embed(e,o,r){let a={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0,rotation:!0,contextMenu:!0},initialViewport:void 0,origin:"https://felt.com"},i=r?.origin??a.origin,m=new URL(`${i}/embed/map/${o}`),u={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar",rotation:"rotation",contextMenu:"contextMenu"},p={...a.uiControls,...r?.uiControls};for(let[l,c]of q(p))c!=null&&m.searchParams.set(u[l],c?"1":"0");if(r?.token&&m.searchParams.set("token",r.token),r?.initialViewport){let l=r.initialViewport;m.searchParams.set("loc",`${l.center.latitude},${l.center.longitude},${l.zoom}z`)}let g=e.tagName==="IFRAME",s=g?e:e.ownerDocument.createElement("iframe");return s.src=m.toString(),g||(s.style.width="100%",s.style.height="100%",s.style.border="none",s.style.margin="0",e.appendChild(s)),s.referrerPolicy="strict-origin-when-cross-origin",new Promise((l,c)=>{s.addEventListener("load",()=>{s.contentWindow==null?c(new Error("Failed to load Felt map")):l(s.contentWindow)},{once:!0})}).then(U.connect).then(l=>(Object.defineProperties(l,{iframe:{value:s,writable:!1,configurable:!1}}),l))},connect(e){let o=x(e);if(arguments.length===2){let r=arguments[1];if(r&&typeof r=="object"&&"skipReadyCheck"in r&&r.skipReadyCheck)return Promise.resolve(o)}return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Failed to load Felt map")),clearInterval(g),u()},5e3),m=[];function u(){for(let s of m)s.port1.onmessage=null,s.port1.close(),s.port2.close();m.length=0}function p(){let s=new MessageChannel;m.push(s),s.port1.onmessage=l=>{l.data===!0&&(clearInterval(g),clearTimeout(i),u(),r(o))},e.postMessage({type:"felt.ready"},"*",[s.port2])}let g=setInterval(p,100);p()})}},q=Object.entries;0&&(module.exports={Felt});
|
package/dist/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-
|
|
2
|
-
export { aC as AggregatedGridConfig, aD as AggregationConfig, aE as AggregationMethod, a as Basemap, B as BasemapsController, f as CircleElementCreate, g as CircleElementRead, h as CircleElementUpdate,
|
|
1
|
+
import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-m5hIgJCz.cjs';
|
|
2
|
+
export { aC as AggregatedGridConfig, aD as AggregationConfig, aE as AggregationMethod, a as Basemap, B as BasemapsController, f as CircleElementCreate, g as CircleElementRead, h as CircleElementUpdate, bu as CircleToolSettings, C as ColorBasemap, b as ColorBasemapInput, bv as ConfigurableToolType, aF as CountGridConfig, bL as CreateActionTriggerParams, bM as CreateFeatureActionParams, Y as CreateLayersFromGeoJsonParams, bN as CreateOrUpdatePanelParams, bO as CreatePanelElementsParams, c as CustomTileBasemap, d as CustomTileBasemapInput, Z as DataOnlyLayer, bP as DeletePanelElementsParams, E as Element, i as ElementChangeCallbackParams, j as ElementCreate, k as ElementGroup, l as ElementGroupChangeCallbackParams, b6 as ElementGroupNode, b7 as ElementNode, m as ElementUpdate, S as ElementsController, b8 as EntityNode, b9 as FeatureNode, ba as FeatureSelection, e as FeltBasemap, be as FeltBoundary, _ as FeltTiledVectorSource, bf as FeltZoom, av as FilterExpression, aw as FilterLogicGate, ax as FilterTernary, ay as Filters, $ as GeoJsonDataVectorSource, bg as GeoJsonFeature, a0 as GeoJsonFileVectorSource, bh as GeoJsonGeometry, bi as GeoJsonProperties, a1 as GeoJsonUrlVectorSource, az as GeometryFilter, G as GetElementGroupsConstraint, n as GetElementsConstraint, aG as GetLayerCalculationParams, aH as GetLayerCategoriesGroup, aI as GetLayerCategoriesParams, a2 as GetLayerGroupsConstraint, aJ as GetLayerHistogramBin, aK as GetLayerHistogramParams, aL as GetLayerPrecomputedCalculationParams, a3 as GetLayersConstraint, aR as GetRasterAggregatesParams, aS as GetRasterAggregatesResult, aT as GetRasterCategoriesParams, aU as GetRasterCategoriesResult, aV as GetRasterHistogramParams, aW as GetRasterHistogramResult, aX as GetRasterProfileParams, aY as GetRasterProfileResult, a4 as GetRenderedFeaturesConstraint, aM as GridConfig, aN as GridType, H as HighlighterElementCreate, o as HighlighterElementRead, p as HighlighterElementUpdate, bw as HighlighterToolSettings, I as ImageElementCreate, q as ImageElementRead, r as ImageElementUpdate, bx as InputToolSettings, X as InteractionsController, bj as LatLng, a5 as Layer, aA as LayerBoundaries, a6 as LayerChangeCallbackParams, a7 as LayerCommon, al as LayerFeature, aB as LayerFilters, a8 as LayerGroup, a9 as LayerGroupChangeCallbackParams, bb as LayerGroupNode, bc as LayerNode, aa as LayerProcessingStatus, an as LayerSchema, ao as LayerSchemaAttribute, ap as LayerSchemaBooleanAttribute, aq as LayerSchemaCommonAttribute, ar as LayerSchemaDateAttribute, as as LayerSchemaDateTimeAttribute, at as LayerSchemaNumericAttribute, au as LayerSchemaTextAttribute, b3 as LayersController, ab as LegendDisplay, ac as LegendItem, ad as LegendItemChangeCallbackParams, ae as LegendItemIdentifier, af as LegendItemsConstraint, bk as LineStringGeometry, by as LineToolSettings, L as LinkElementRead, bl as LngLatTuple, b4 as MapDetails, W as MapInteractionEvent, M as MarkerElementCreate, s as MarkerElementRead, t as MarkerElementUpdate, bz as MarkerToolSettings, b5 as MiscController, aO as MultiAggregationConfig, bm as MultiLineStringGeometry, bn as MultiPointGeometry, bo as MultiPolygonGeometry, N as NoteElementCreate, u as NoteElementRead, v as NoteElementUpdate, bA as NoteToolSettings, bQ as OnMapInteractionsOptions, P as PathElementCreate, w as PathElementRead, x as PathElementUpdate, bB as PinToolSettings, y as PlaceElementCreate, A as PlaceElementRead, D as PlaceElementUpdate, bC as PlaceFrame, bD as PlaceSymbol, bU as PlacementForUIElement, bp as PointGeometry, J as PolygonElementCreate, K as PolygonElementRead, O as PolygonElementUpdate, bq as PolygonGeometry, bE as PolygonToolSettings, aP as PrecomputedAggregationMethod, aZ as RasterAggregationMethod, ag as RasterBand, a_ as RasterCategory, a$ as RasterGeometryFilter, b0 as RasterHistogramBin, ah as RasterLayer, ai as RasterLayerSource, b1 as RasterPercentile, b2 as RasterProfileSample, am as RasterValue, bF as RouteToolSettings, bd as SelectionController, cD as SetViewportCenterZoomParams, br as SetVisibilityRequest, bs as SortConfig, bt as SortDirection, T as TextElementCreate, Q as TextElementRead, R as TextElementUpdate, bG as TextToolSettings, bH as ToolSettingsChangeEvent, bI as ToolSettingsMap, bJ as ToolType, bK as ToolsController, cz as UIActionTriggerCreate, bX as UIButtonElement, bY as UIButtonElementCreate, bZ as UIButtonElementUpdate, cj as UIButtonRowElement, ck as UIButtonRowElementCreate, cl as UIButtonRowElementUpdate, cm as UICheckboxGroupElement, cn as UICheckboxGroupElementCreate, co as UICheckboxGroupElementUpdate, cy as UIControlElementOption, c4 as UIDividerElement, c5 as UIDividerElementCreate, c6 as UIDividerElementUpdate, cA as UIFeatureAction, cB as UIFeatureActionCreate, c1 as UIFlexibleSpaceElement, c2 as UIFlexibleSpaceElementCreate, c3 as UIFlexibleSpaceElementUpdate, cg as UIGridContainerElement, ch as UIGridContainerElementCreate, ci as UIGridContainerElementUpdate, cv as UIIframeElement, cw as UIIframeElementCreate, cx as UIIframeElementUpdate, bV as UIPanel, bW as UIPanelCreateOrUpdate, cd as UIPanelElement, ce as UIPanelElementCreate, cf as UIPanelElementUpdate, cp as UIRadioGroupElement, cq as UIRadioGroupElementCreate, cr as UIRadioGroupElementUpdate, ca as UISelectElement, cb as UISelectElementCreate, cc as UISelectElementUpdate, b_ as UITextElement, b$ as UITextElementCreate, c0 as UITextElementUpdate, c7 as UITextInputElement, c8 as UITextInputElementCreate, c9 as UITextInputElementUpdate, cs as UIToggleGroupElement, ct as UIToggleGroupElementCreate, cu as UIToggleGroupElementUpdate, cC as UiController, bR as UpdateActionTriggerParams, bS as UpdateFeatureActionParams, aj as UpdateLayerParams, bT as UpdatePanelElementsParams, aQ as ValueConfiguration, ak as VectorLayer, cE as ViewportConstraints, cH as ViewportController, cF as ViewportFitBoundsParams, cG as ViewportState } from './controller-m5hIgJCz.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,20 +30,26 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
30
30
|
geolocation: z.ZodOptional<z.ZodBoolean>;
|
|
31
31
|
zoomControls: z.ZodOptional<z.ZodBoolean>;
|
|
32
32
|
scaleBar: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
rotation: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
contextMenu: z.ZodOptional<z.ZodBoolean>;
|
|
33
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
rotation?: boolean | undefined;
|
|
34
37
|
showLegend?: boolean | undefined;
|
|
35
38
|
cooperativeGestures?: boolean | undefined;
|
|
36
39
|
fullScreenButton?: boolean | undefined;
|
|
37
40
|
geolocation?: boolean | undefined;
|
|
38
41
|
zoomControls?: boolean | undefined;
|
|
39
42
|
scaleBar?: boolean | undefined;
|
|
43
|
+
contextMenu?: boolean | undefined;
|
|
40
44
|
}, {
|
|
45
|
+
rotation?: boolean | undefined;
|
|
41
46
|
showLegend?: boolean | undefined;
|
|
42
47
|
cooperativeGestures?: boolean | undefined;
|
|
43
48
|
fullScreenButton?: boolean | undefined;
|
|
44
49
|
geolocation?: boolean | undefined;
|
|
45
50
|
zoomControls?: boolean | undefined;
|
|
46
51
|
scaleBar?: boolean | undefined;
|
|
52
|
+
contextMenu?: boolean | undefined;
|
|
47
53
|
}>>;
|
|
48
54
|
initialViewport: z.ZodOptional<z.ZodObject<{
|
|
49
55
|
center: z.ZodObject<{
|
|
@@ -74,12 +80,14 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
74
80
|
origin?: string | undefined;
|
|
75
81
|
token?: string | undefined;
|
|
76
82
|
uiControls?: {
|
|
83
|
+
rotation?: boolean | undefined;
|
|
77
84
|
showLegend?: boolean | undefined;
|
|
78
85
|
cooperativeGestures?: boolean | undefined;
|
|
79
86
|
fullScreenButton?: boolean | undefined;
|
|
80
87
|
geolocation?: boolean | undefined;
|
|
81
88
|
zoomControls?: boolean | undefined;
|
|
82
89
|
scaleBar?: boolean | undefined;
|
|
90
|
+
contextMenu?: boolean | undefined;
|
|
83
91
|
} | undefined;
|
|
84
92
|
initialViewport?: {
|
|
85
93
|
center: {
|
|
@@ -92,12 +100,14 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
92
100
|
origin?: string | undefined;
|
|
93
101
|
token?: string | undefined;
|
|
94
102
|
uiControls?: {
|
|
103
|
+
rotation?: boolean | undefined;
|
|
95
104
|
showLegend?: boolean | undefined;
|
|
96
105
|
cooperativeGestures?: boolean | undefined;
|
|
97
106
|
fullScreenButton?: boolean | undefined;
|
|
98
107
|
geolocation?: boolean | undefined;
|
|
99
108
|
zoomControls?: boolean | undefined;
|
|
100
109
|
scaleBar?: boolean | undefined;
|
|
110
|
+
contextMenu?: boolean | undefined;
|
|
101
111
|
} | undefined;
|
|
102
112
|
initialViewport?: {
|
|
103
113
|
center: {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-
|
|
2
|
-
export { aC as AggregatedGridConfig, aD as AggregationConfig, aE as AggregationMethod, a as Basemap, B as BasemapsController, f as CircleElementCreate, g as CircleElementRead, h as CircleElementUpdate,
|
|
1
|
+
import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-m5hIgJCz.js';
|
|
2
|
+
export { aC as AggregatedGridConfig, aD as AggregationConfig, aE as AggregationMethod, a as Basemap, B as BasemapsController, f as CircleElementCreate, g as CircleElementRead, h as CircleElementUpdate, bu as CircleToolSettings, C as ColorBasemap, b as ColorBasemapInput, bv as ConfigurableToolType, aF as CountGridConfig, bL as CreateActionTriggerParams, bM as CreateFeatureActionParams, Y as CreateLayersFromGeoJsonParams, bN as CreateOrUpdatePanelParams, bO as CreatePanelElementsParams, c as CustomTileBasemap, d as CustomTileBasemapInput, Z as DataOnlyLayer, bP as DeletePanelElementsParams, E as Element, i as ElementChangeCallbackParams, j as ElementCreate, k as ElementGroup, l as ElementGroupChangeCallbackParams, b6 as ElementGroupNode, b7 as ElementNode, m as ElementUpdate, S as ElementsController, b8 as EntityNode, b9 as FeatureNode, ba as FeatureSelection, e as FeltBasemap, be as FeltBoundary, _ as FeltTiledVectorSource, bf as FeltZoom, av as FilterExpression, aw as FilterLogicGate, ax as FilterTernary, ay as Filters, $ as GeoJsonDataVectorSource, bg as GeoJsonFeature, a0 as GeoJsonFileVectorSource, bh as GeoJsonGeometry, bi as GeoJsonProperties, a1 as GeoJsonUrlVectorSource, az as GeometryFilter, G as GetElementGroupsConstraint, n as GetElementsConstraint, aG as GetLayerCalculationParams, aH as GetLayerCategoriesGroup, aI as GetLayerCategoriesParams, a2 as GetLayerGroupsConstraint, aJ as GetLayerHistogramBin, aK as GetLayerHistogramParams, aL as GetLayerPrecomputedCalculationParams, a3 as GetLayersConstraint, aR as GetRasterAggregatesParams, aS as GetRasterAggregatesResult, aT as GetRasterCategoriesParams, aU as GetRasterCategoriesResult, aV as GetRasterHistogramParams, aW as GetRasterHistogramResult, aX as GetRasterProfileParams, aY as GetRasterProfileResult, a4 as GetRenderedFeaturesConstraint, aM as GridConfig, aN as GridType, H as HighlighterElementCreate, o as HighlighterElementRead, p as HighlighterElementUpdate, bw as HighlighterToolSettings, I as ImageElementCreate, q as ImageElementRead, r as ImageElementUpdate, bx as InputToolSettings, X as InteractionsController, bj as LatLng, a5 as Layer, aA as LayerBoundaries, a6 as LayerChangeCallbackParams, a7 as LayerCommon, al as LayerFeature, aB as LayerFilters, a8 as LayerGroup, a9 as LayerGroupChangeCallbackParams, bb as LayerGroupNode, bc as LayerNode, aa as LayerProcessingStatus, an as LayerSchema, ao as LayerSchemaAttribute, ap as LayerSchemaBooleanAttribute, aq as LayerSchemaCommonAttribute, ar as LayerSchemaDateAttribute, as as LayerSchemaDateTimeAttribute, at as LayerSchemaNumericAttribute, au as LayerSchemaTextAttribute, b3 as LayersController, ab as LegendDisplay, ac as LegendItem, ad as LegendItemChangeCallbackParams, ae as LegendItemIdentifier, af as LegendItemsConstraint, bk as LineStringGeometry, by as LineToolSettings, L as LinkElementRead, bl as LngLatTuple, b4 as MapDetails, W as MapInteractionEvent, M as MarkerElementCreate, s as MarkerElementRead, t as MarkerElementUpdate, bz as MarkerToolSettings, b5 as MiscController, aO as MultiAggregationConfig, bm as MultiLineStringGeometry, bn as MultiPointGeometry, bo as MultiPolygonGeometry, N as NoteElementCreate, u as NoteElementRead, v as NoteElementUpdate, bA as NoteToolSettings, bQ as OnMapInteractionsOptions, P as PathElementCreate, w as PathElementRead, x as PathElementUpdate, bB as PinToolSettings, y as PlaceElementCreate, A as PlaceElementRead, D as PlaceElementUpdate, bC as PlaceFrame, bD as PlaceSymbol, bU as PlacementForUIElement, bp as PointGeometry, J as PolygonElementCreate, K as PolygonElementRead, O as PolygonElementUpdate, bq as PolygonGeometry, bE as PolygonToolSettings, aP as PrecomputedAggregationMethod, aZ as RasterAggregationMethod, ag as RasterBand, a_ as RasterCategory, a$ as RasterGeometryFilter, b0 as RasterHistogramBin, ah as RasterLayer, ai as RasterLayerSource, b1 as RasterPercentile, b2 as RasterProfileSample, am as RasterValue, bF as RouteToolSettings, bd as SelectionController, cD as SetViewportCenterZoomParams, br as SetVisibilityRequest, bs as SortConfig, bt as SortDirection, T as TextElementCreate, Q as TextElementRead, R as TextElementUpdate, bG as TextToolSettings, bH as ToolSettingsChangeEvent, bI as ToolSettingsMap, bJ as ToolType, bK as ToolsController, cz as UIActionTriggerCreate, bX as UIButtonElement, bY as UIButtonElementCreate, bZ as UIButtonElementUpdate, cj as UIButtonRowElement, ck as UIButtonRowElementCreate, cl as UIButtonRowElementUpdate, cm as UICheckboxGroupElement, cn as UICheckboxGroupElementCreate, co as UICheckboxGroupElementUpdate, cy as UIControlElementOption, c4 as UIDividerElement, c5 as UIDividerElementCreate, c6 as UIDividerElementUpdate, cA as UIFeatureAction, cB as UIFeatureActionCreate, c1 as UIFlexibleSpaceElement, c2 as UIFlexibleSpaceElementCreate, c3 as UIFlexibleSpaceElementUpdate, cg as UIGridContainerElement, ch as UIGridContainerElementCreate, ci as UIGridContainerElementUpdate, cv as UIIframeElement, cw as UIIframeElementCreate, cx as UIIframeElementUpdate, bV as UIPanel, bW as UIPanelCreateOrUpdate, cd as UIPanelElement, ce as UIPanelElementCreate, cf as UIPanelElementUpdate, cp as UIRadioGroupElement, cq as UIRadioGroupElementCreate, cr as UIRadioGroupElementUpdate, ca as UISelectElement, cb as UISelectElementCreate, cc as UISelectElementUpdate, b_ as UITextElement, b$ as UITextElementCreate, c0 as UITextElementUpdate, c7 as UITextInputElement, c8 as UITextInputElementCreate, c9 as UITextInputElementUpdate, cs as UIToggleGroupElement, ct as UIToggleGroupElementCreate, cu as UIToggleGroupElementUpdate, cC as UiController, bR as UpdateActionTriggerParams, bS as UpdateFeatureActionParams, aj as UpdateLayerParams, bT as UpdatePanelElementsParams, aQ as ValueConfiguration, ak as VectorLayer, cE as ViewportConstraints, cH as ViewportController, cF as ViewportFitBoundsParams, cG as ViewportState } from './controller-m5hIgJCz.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,20 +30,26 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
30
30
|
geolocation: z.ZodOptional<z.ZodBoolean>;
|
|
31
31
|
zoomControls: z.ZodOptional<z.ZodBoolean>;
|
|
32
32
|
scaleBar: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
rotation: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
contextMenu: z.ZodOptional<z.ZodBoolean>;
|
|
33
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
rotation?: boolean | undefined;
|
|
34
37
|
showLegend?: boolean | undefined;
|
|
35
38
|
cooperativeGestures?: boolean | undefined;
|
|
36
39
|
fullScreenButton?: boolean | undefined;
|
|
37
40
|
geolocation?: boolean | undefined;
|
|
38
41
|
zoomControls?: boolean | undefined;
|
|
39
42
|
scaleBar?: boolean | undefined;
|
|
43
|
+
contextMenu?: boolean | undefined;
|
|
40
44
|
}, {
|
|
45
|
+
rotation?: boolean | undefined;
|
|
41
46
|
showLegend?: boolean | undefined;
|
|
42
47
|
cooperativeGestures?: boolean | undefined;
|
|
43
48
|
fullScreenButton?: boolean | undefined;
|
|
44
49
|
geolocation?: boolean | undefined;
|
|
45
50
|
zoomControls?: boolean | undefined;
|
|
46
51
|
scaleBar?: boolean | undefined;
|
|
52
|
+
contextMenu?: boolean | undefined;
|
|
47
53
|
}>>;
|
|
48
54
|
initialViewport: z.ZodOptional<z.ZodObject<{
|
|
49
55
|
center: z.ZodObject<{
|
|
@@ -74,12 +80,14 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
74
80
|
origin?: string | undefined;
|
|
75
81
|
token?: string | undefined;
|
|
76
82
|
uiControls?: {
|
|
83
|
+
rotation?: boolean | undefined;
|
|
77
84
|
showLegend?: boolean | undefined;
|
|
78
85
|
cooperativeGestures?: boolean | undefined;
|
|
79
86
|
fullScreenButton?: boolean | undefined;
|
|
80
87
|
geolocation?: boolean | undefined;
|
|
81
88
|
zoomControls?: boolean | undefined;
|
|
82
89
|
scaleBar?: boolean | undefined;
|
|
90
|
+
contextMenu?: boolean | undefined;
|
|
83
91
|
} | undefined;
|
|
84
92
|
initialViewport?: {
|
|
85
93
|
center: {
|
|
@@ -92,12 +100,14 @@ declare const FeltEmbedOptionsSchema: z.ZodObject<{
|
|
|
92
100
|
origin?: string | undefined;
|
|
93
101
|
token?: string | undefined;
|
|
94
102
|
uiControls?: {
|
|
103
|
+
rotation?: boolean | undefined;
|
|
95
104
|
showLegend?: boolean | undefined;
|
|
96
105
|
cooperativeGestures?: boolean | undefined;
|
|
97
106
|
fullScreenButton?: boolean | undefined;
|
|
98
107
|
geolocation?: boolean | undefined;
|
|
99
108
|
zoomControls?: boolean | undefined;
|
|
100
109
|
scaleBar?: boolean | undefined;
|
|
110
|
+
contextMenu?: boolean | undefined;
|
|
101
111
|
} | undefined;
|
|
102
112
|
initialViewport?: {
|
|
103
113
|
center: {
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function y(e,s){for(let[r,
|
|
1
|
+
function y(e,s){for(let[r,a]of Object.entries(e))switch(typeof a){case"object":switch(!0){case Array.isArray(a):for(let i of a)y(i,s);break;case a===null:s(r,a,e);break;default:y(a,s);break}break;default:s(r,a,e);break}}function x(e){return e[0]?.toUpperCase()===e[0]}function U(e){return e.startsWith("on")&&x(e.slice(2))}function P(e,s){typeof e=="object"&&e!==null&&y(e,(r,a,i)=>{U(r)&&s(r,a,i)})}function o(e,s){return r=>{let a=new MessageChannel,i=r.handler,m="options"in r?r.options:void 0,u=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:m?{eventName:s,id:u,options:m}:{eventName:s,id:u}},"*",[a.port2]),a.port1.onmessage=p=>{T(p)||i(p.data)},()=>{a.port1.onmessage=null,a.port1.close(),a.port2.close(),e.postMessage({type:"felt.removeListener",id:u},"*")}}}function t(e,s,r){return async a=>{let i=new MessageChannel,m=a&&r?await r(a):a;return e.postMessage({type:s,params:m},"*",[i.port2]),new Promise((u,p)=>{i.port1.onmessage=g=>{T(g)?p(new Error(g.data.__error__)):u(g.data),i.port1.close(),i.port2.close()}})}}var h={};function d(e,s){let r=t(e,s),a=o(e,"onGenericEvent");return async i=>{let m=[];P(i,(g,n,l)=>{if(typeof n!="function")return;let c=crypto.randomUUID();l[g]=c,h[c]=n;let C=a({handler:L=>{switch(L){case`felt.removeGenericListener:${c}`:C();break;default:n(L)}},options:{id:c}});m.push(C)});let p=await r(i);return typeof p=="object"&&p!==null&&P(p,(g,n,l)=>{if(typeof n!="string")return;let c=h[n];c&&(l[g]=c)}),p}}function T(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var E=e=>({getCurrentBasemap:t(e,"getCurrentBasemap"),getBasemaps:t(e,"getBasemaps"),chooseBasemap:t(e,"chooseBasemap"),addCustomBasemap:t(e,"addCustomBasemap"),removeBasemap:t(e,"removeBasemap"),onBasemapChange:o(e,"onBasemapChange")});var v=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:o(e,"onElementChange"),onElementCreate:o(e,"onElementCreate"),onElementCreateEnd:o(e,"onElementCreateEnd"),onElementDelete:o(e,"onElementDelete"),onElementGroupChange:o(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var F=e=>({onPointerClick:o(e,"onPointerClick"),onPointerMove:o(e,"onPointerMove")});var b=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:o(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",G),updateLayer:t(e,"updateLayer",G),deleteLayer:t(e,"deleteLayer"),duplicateLayer:t(e,"duplicateLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:o(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:o(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:o(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:o(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getPrecomputedAggregates:t(e,"getPrecomputedAggregates"),getRasterAggregates:t(e,"getRasterAggregates"),getRasterHistogramData:t(e,"getRasterHistogramData"),getRasterCategoryData:t(e,"getRasterCategoryData"),getRasterProfile:t(e,"getRasterProfile"),getLayerSchema:t(e,"getLayerSchema")});async function G(e){let{source:s}=e;return s&&s.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await s.file.text())}}:e}var I=e=>({getMapDetails:t(e,"getMapDetails")});var M=e=>({onSelectionChange:o(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var V=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:o(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:o(e,"onToolSettingsChange")});var S=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable"),createPanelId:t(e,"createPanelId"),createOrUpdatePanel:d(e,"createOrUpdatePanel"),deletePanel:t(e,"deletePanel"),createPanelElements:d(e,"createPanelElements"),updatePanelElements:d(e,"updatePanelElements"),deletePanelElements:t(e,"deletePanelElements"),createActionTrigger:d(e,"createActionTrigger"),updateActionTrigger:d(e,"updateActionTrigger"),deleteActionTrigger:t(e,"deleteActionTrigger"),createFeatureAction:d(e,"createFeatureAction"),updateFeatureAction:d(e,"updateFeatureAction"),deleteFeatureAction:t(e,"deleteFeatureAction")});var A=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:o(e,"onViewportMove"),onViewportMoveEnd:o(e,"onViewportMoveEnd"),onMapIdle:o(e,"onMapIdle")});function f(e){return{iframe:null,...A(e),...S(e),...b(e),...v(e),...M(e),...F(e),...V(e),...I(e),...E(e)}}var k={embed(e,s,r){let a={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0,rotation:!0,contextMenu:!0},initialViewport:void 0,origin:"https://felt.com"},i=r?.origin??a.origin,m=new URL(`${i}/embed/map/${s}`),u={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar",rotation:"rotation",contextMenu:"contextMenu"},p={...a.uiControls,...r?.uiControls};for(let[l,c]of R(p))c!=null&&m.searchParams.set(u[l],c?"1":"0");if(r?.token&&m.searchParams.set("token",r.token),r?.initialViewport){let l=r.initialViewport;m.searchParams.set("loc",`${l.center.latitude},${l.center.longitude},${l.zoom}z`)}let g=e.tagName==="IFRAME",n=g?e:e.ownerDocument.createElement("iframe");return n.src=m.toString(),g||(n.style.width="100%",n.style.height="100%",n.style.border="none",n.style.margin="0",e.appendChild(n)),n.referrerPolicy="strict-origin-when-cross-origin",new Promise((l,c)=>{n.addEventListener("load",()=>{n.contentWindow==null?c(new Error("Failed to load Felt map")):l(n.contentWindow)},{once:!0})}).then(k.connect).then(l=>(Object.defineProperties(l,{iframe:{value:n,writable:!1,configurable:!1}}),l))},connect(e){let s=f(e);if(arguments.length===2){let r=arguments[1];if(r&&typeof r=="object"&&"skipReadyCheck"in r&&r.skipReadyCheck)return Promise.resolve(s)}return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Failed to load Felt map")),clearInterval(g),u()},5e3),m=[];function u(){for(let n of m)n.port1.onmessage=null,n.port1.close(),n.port2.close();m.length=0}function p(){let n=new MessageChannel;m.push(n),n.port1.onmessage=l=>{l.data===!0&&(clearInterval(g),clearTimeout(i),u(),r(s))},e.postMessage({type:"felt.ready"},"*",[n.port2])}let g=setInterval(p,100);p()})}},R=Object.entries;export{k as Felt};
|