diff --git a/.changeset/sharp-files-dance.md b/.changeset/sharp-files-dance.md new file mode 100644 index 00000000..5cbce2ca --- /dev/null +++ b/.changeset/sharp-files-dance.md @@ -0,0 +1,5 @@ +--- +"@feltmaps/js-sdk": minor +--- + +Add duplicateLayer method diff --git a/DEVELOPING.md b/DEVELOPING.md index 0656f32e..fc828d9b 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -70,12 +70,13 @@ Once you have added your module: 1. Run `npm run build` to ensure everything compiles and the docs are generated. It's possible for the docs to fail to build if some types are not exported, but you will be warned in the console about this. -1. Run `npm run update-api` to run api-extractor which updates the "api spec" file, which allows +2. Run `npm run update-api` to run api-extractor which updates the "api spec" file, which allows reviewers to understand the changes made to the API. -1. Stage or commit your changes. This is important, because the next step will fail if you have +3. Stage or commit your changes. This is important, because the next step will fail if you have docs changes that are unstaged as it is used to check that the docs are up to date. -1. Run `npm run check` which will check that the package is correctly built, the docs have been +4. Run `npm run check` which will check that the package is correctly built, the docs have been updated, the API spec has been updated and the tests are passing. +5. If you make any further changes, run steps 1 to 4 again. If this all works, your module is ready and should be working. diff --git a/docs/Layers/LayersController.md b/docs/Layers/LayersController.md index 220362da..15410372 100644 --- a/docs/Layers/LayersController.md +++ b/docs/Layers/LayersController.md @@ -268,6 +268,36 @@ await felt.deleteLayer("layer-1"); *** +## duplicateLayer() + +> **duplicateLayer**(`id`: `string`): `Promise`\<[`Layer`](Layer.md)> + +Duplicate a layer from the map by its id. + +### Parameters + +| Parameter | Type | +| --------- | -------- | +| `id` | `string` | + +### Returns + +`Promise`\<[`Layer`](Layer.md)> + +The duplicated layer. + +### Remarks + +This will create an ephemeral copy of the layer, just for the duration of the session. The duplicated layer will not be persisted to the map. + +### Example + +```typescript +const duplicatedLayer = await felt.duplicateLayer("layer-1"); +``` + +*** + ## getLayerGroup() > **getLayerGroup**(`id`: `string`): `Promise`\<`null` | [`LayerGroup`](LayerGroup.md)> diff --git a/docs/Main/FeltController.md b/docs/Main/FeltController.md index 86e4db19..4133bfd9 100644 --- a/docs/Main/FeltController.md +++ b/docs/Main/FeltController.md @@ -567,6 +567,36 @@ await felt.deleteLayer("layer-1"); *** +## duplicateLayer() + +> **duplicateLayer**(`id`: `string`): `Promise`\<[`Layer`](../Layers/Layer.md)> + +Duplicate a layer from the map by its id. + +### Parameters + +| Parameter | Type | +| --------- | -------- | +| `id` | `string` | + +### Returns + +`Promise`\<[`Layer`](../Layers/Layer.md)> + +The duplicated layer. + +### Remarks + +This will create an ephemeral copy of the layer, just for the duration of the session. The duplicated layer will not be persisted to the map. + +### Example + +```typescript +const duplicatedLayer = await felt.duplicateLayer("layer-1"); +``` + +*** + ## getLayerGroup() > **getLayerGroup**(`id`: `string`): `Promise`\<`null` | [`LayerGroup`](../Layers/LayerGroup.md)> diff --git a/etc/js-sdk.api.md b/etc/js-sdk.api.md index 45ae0c5c..fc434b97 100644 --- a/etc/js-sdk.api.md +++ b/etc/js-sdk.api.md @@ -4,207 +4,207 @@ ```ts -import { av as AggregatedGridConfig } from './controller-CfSLTEhH.js'; -import { aw as AggregationConfig } from './controller-CfSLTEhH.js'; -import { ax as AggregationMethod } from './controller-CfSLTEhH.js'; -import { C as CircleElementCreate } from './controller-CfSLTEhH.js'; -import { a as CircleElementRead } from './controller-CfSLTEhH.js'; -import { b as CircleElementUpdate } from './controller-CfSLTEhH.js'; -import { b9 as CircleToolSettings } from './controller-CfSLTEhH.js'; -import { ba as ConfigurableToolType } from './controller-CfSLTEhH.js'; -import { ay as CountGridConfig } from './controller-CfSLTEhH.js'; -import { bq as CreateActionTriggerParams } from './controller-CfSLTEhH.js'; -import { K as CreateLayersFromGeoJsonParams } from './controller-CfSLTEhH.js'; -import { br as CreateOrUpdatePanelParams } from './controller-CfSLTEhH.js'; -import { bs as CreatePanelElementsParams } from './controller-CfSLTEhH.js'; -import { O as DataOnlyLayer } from './controller-CfSLTEhH.js'; -import { bt as DeletePanelElementsParams } from './controller-CfSLTEhH.js'; -import { E as Element_2 } from './controller-CfSLTEhH.js'; -import { c as ElementChangeCallbackParams } from './controller-CfSLTEhH.js'; -import { d as ElementCreate } from './controller-CfSLTEhH.js'; -import { e as ElementGroup } from './controller-CfSLTEhH.js'; -import { f as ElementGroupChangeCallbackParams } from './controller-CfSLTEhH.js'; -import { aN as ElementGroupNode } from './controller-CfSLTEhH.js'; -import { aO as ElementNode } from './controller-CfSLTEhH.js'; -import { B as ElementsController } from './controller-CfSLTEhH.js'; -import { g as ElementUpdate } from './controller-CfSLTEhH.js'; -import { aP as EntityNode } from './controller-CfSLTEhH.js'; -import { aQ as FeatureNode } from './controller-CfSLTEhH.js'; -import { aR as FeatureSelection } from './controller-CfSLTEhH.js'; -import { aV as FeltBoundary } from './controller-CfSLTEhH.js'; -import { F as FeltController } from './controller-CfSLTEhH.js'; -import { Q as FeltTiledVectorSource } from './controller-CfSLTEhH.js'; -import { aW as FeltZoom } from './controller-CfSLTEhH.js'; -import { ao as FilterExpression } from './controller-CfSLTEhH.js'; -import { ap as FilterLogicGate } from './controller-CfSLTEhH.js'; -import { ar as Filters } from './controller-CfSLTEhH.js'; -import { aq as FilterTernary } from './controller-CfSLTEhH.js'; -import { R as GeoJsonDataVectorSource } from './controller-CfSLTEhH.js'; -import { aX as GeoJsonFeature } from './controller-CfSLTEhH.js'; -import { S as GeoJsonFileVectorSource } from './controller-CfSLTEhH.js'; -import { aY as GeoJsonGeometry } from './controller-CfSLTEhH.js'; -import { aZ as GeoJsonProperties } from './controller-CfSLTEhH.js'; -import { W as GeoJsonUrlVectorSource } from './controller-CfSLTEhH.js'; -import { as as GeometryFilter } from './controller-CfSLTEhH.js'; -import { G as GetElementGroupsConstraint } from './controller-CfSLTEhH.js'; -import { h as GetElementsConstraint } from './controller-CfSLTEhH.js'; -import { az as GetLayerCalculationParams } from './controller-CfSLTEhH.js'; -import { aA as GetLayerCategoriesGroup } from './controller-CfSLTEhH.js'; -import { aB as GetLayerCategoriesParams } from './controller-CfSLTEhH.js'; -import { X as GetLayerGroupsConstraint } from './controller-CfSLTEhH.js'; -import { aC as GetLayerHistogramBin } from './controller-CfSLTEhH.js'; -import { aD as GetLayerHistogramParams } from './controller-CfSLTEhH.js'; -import { aE as GetLayerPrecomputedCalculationParams } from './controller-CfSLTEhH.js'; -import { Y as GetLayersConstraint } from './controller-CfSLTEhH.js'; -import { Z as GetRenderedFeaturesConstraint } from './controller-CfSLTEhH.js'; -import { aF as GridConfig } from './controller-CfSLTEhH.js'; -import { aG as GridType } from './controller-CfSLTEhH.js'; -import { H as HighlighterElementCreate } from './controller-CfSLTEhH.js'; -import { i as HighlighterElementRead } from './controller-CfSLTEhH.js'; -import { j as HighlighterElementUpdate } from './controller-CfSLTEhH.js'; -import { bb as HighlighterToolSettings } from './controller-CfSLTEhH.js'; -import { I as ImageElementCreate } from './controller-CfSLTEhH.js'; -import { k as ImageElementRead } from './controller-CfSLTEhH.js'; -import { l as ImageElementUpdate } from './controller-CfSLTEhH.js'; -import { bc as InputToolSettings } from './controller-CfSLTEhH.js'; -import { J as InteractionsController } from './controller-CfSLTEhH.js'; -import { a_ as LatLng } from './controller-CfSLTEhH.js'; -import { _ as Layer } from './controller-CfSLTEhH.js'; -import { at as LayerBoundaries } from './controller-CfSLTEhH.js'; -import { $ as LayerChangeCallbackParams } from './controller-CfSLTEhH.js'; -import { a0 as LayerCommon } from './controller-CfSLTEhH.js'; -import { ae as LayerFeature } from './controller-CfSLTEhH.js'; -import { au as LayerFilters } from './controller-CfSLTEhH.js'; -import { a1 as LayerGroup } from './controller-CfSLTEhH.js'; -import { a2 as LayerGroupChangeCallbackParams } from './controller-CfSLTEhH.js'; -import { aS as LayerGroupNode } from './controller-CfSLTEhH.js'; -import { aT as LayerNode } from './controller-CfSLTEhH.js'; -import { a3 as LayerProcessingStatus } from './controller-CfSLTEhH.js'; -import { ag as LayerSchema } from './controller-CfSLTEhH.js'; -import { ah as LayerSchemaAttribute } from './controller-CfSLTEhH.js'; -import { ai as LayerSchemaBooleanAttribute } from './controller-CfSLTEhH.js'; -import { aj as LayerSchemaCommonAttribute } from './controller-CfSLTEhH.js'; -import { ak as LayerSchemaDateAttribute } from './controller-CfSLTEhH.js'; -import { al as LayerSchemaDateTimeAttribute } from './controller-CfSLTEhH.js'; -import { am as LayerSchemaNumericAttribute } from './controller-CfSLTEhH.js'; -import { an as LayerSchemaTextAttribute } from './controller-CfSLTEhH.js'; -import { aK as LayersController } from './controller-CfSLTEhH.js'; -import { a4 as LegendDisplay } from './controller-CfSLTEhH.js'; -import { a5 as LegendItem } from './controller-CfSLTEhH.js'; -import { a6 as LegendItemChangeCallbackParams } from './controller-CfSLTEhH.js'; -import { a7 as LegendItemIdentifier } from './controller-CfSLTEhH.js'; -import { a8 as LegendItemsConstraint } from './controller-CfSLTEhH.js'; -import { a$ as LineStringGeometry } from './controller-CfSLTEhH.js'; -import { bd as LineToolSettings } from './controller-CfSLTEhH.js'; -import { L as LinkElementRead } from './controller-CfSLTEhH.js'; -import { b0 as LngLatTuple } from './controller-CfSLTEhH.js'; -import { aL as MapDetails } from './controller-CfSLTEhH.js'; -import { D as MapInteractionEvent } from './controller-CfSLTEhH.js'; -import { M as MarkerElementCreate } from './controller-CfSLTEhH.js'; -import { m as MarkerElementRead } from './controller-CfSLTEhH.js'; -import { n as MarkerElementUpdate } from './controller-CfSLTEhH.js'; -import { be as MarkerToolSettings } from './controller-CfSLTEhH.js'; -import { aM as MiscController } from './controller-CfSLTEhH.js'; -import { aH as MultiAggregationConfig } from './controller-CfSLTEhH.js'; -import { b1 as MultiLineStringGeometry } from './controller-CfSLTEhH.js'; -import { b2 as MultiPointGeometry } from './controller-CfSLTEhH.js'; -import { b3 as MultiPolygonGeometry } from './controller-CfSLTEhH.js'; -import { N as NoteElementCreate } from './controller-CfSLTEhH.js'; -import { o as NoteElementRead } from './controller-CfSLTEhH.js'; -import { p as NoteElementUpdate } from './controller-CfSLTEhH.js'; -import { bf as NoteToolSettings } from './controller-CfSLTEhH.js'; -import { bu as OnMapInteractionsOptions } from './controller-CfSLTEhH.js'; -import { P as PathElementCreate } from './controller-CfSLTEhH.js'; -import { q as PathElementRead } from './controller-CfSLTEhH.js'; -import { r as PathElementUpdate } from './controller-CfSLTEhH.js'; -import { bg as PinToolSettings } from './controller-CfSLTEhH.js'; -import { s as PlaceElementCreate } from './controller-CfSLTEhH.js'; -import { t as PlaceElementRead } from './controller-CfSLTEhH.js'; -import { u as PlaceElementUpdate } from './controller-CfSLTEhH.js'; -import { bh as PlaceFrame } from './controller-CfSLTEhH.js'; -import { bx as PlacementForUIElement } from './controller-CfSLTEhH.js'; -import { bi as PlaceSymbol } from './controller-CfSLTEhH.js'; -import { b4 as PointGeometry } from './controller-CfSLTEhH.js'; -import { v as PolygonElementCreate } from './controller-CfSLTEhH.js'; -import { w as PolygonElementRead } from './controller-CfSLTEhH.js'; -import { x as PolygonElementUpdate } from './controller-CfSLTEhH.js'; -import { b5 as PolygonGeometry } from './controller-CfSLTEhH.js'; -import { bj as PolygonToolSettings } from './controller-CfSLTEhH.js'; -import { aI as PrecomputedAggregationMethod } from './controller-CfSLTEhH.js'; -import { a9 as RasterBand } from './controller-CfSLTEhH.js'; -import { aa as RasterLayer } from './controller-CfSLTEhH.js'; -import { ab as RasterLayerSource } from './controller-CfSLTEhH.js'; -import { af as RasterValue } from './controller-CfSLTEhH.js'; -import { bk as RouteToolSettings } from './controller-CfSLTEhH.js'; -import { aU as SelectionController } from './controller-CfSLTEhH.js'; -import { ce as SetViewportCenterZoomParams } from './controller-CfSLTEhH.js'; -import { b6 as SetVisibilityRequest } from './controller-CfSLTEhH.js'; -import { b7 as SortConfig } from './controller-CfSLTEhH.js'; -import { b8 as SortDirection } from './controller-CfSLTEhH.js'; -import { T as TextElementCreate } from './controller-CfSLTEhH.js'; -import { y as TextElementRead } from './controller-CfSLTEhH.js'; -import { A as TextElementUpdate } from './controller-CfSLTEhH.js'; -import { bl as TextToolSettings } from './controller-CfSLTEhH.js'; -import { bp as ToolsController } from './controller-CfSLTEhH.js'; -import { bm as ToolSettingsChangeEvent } from './controller-CfSLTEhH.js'; -import { bn as ToolSettingsMap } from './controller-CfSLTEhH.js'; -import { bo as ToolType } from './controller-CfSLTEhH.js'; -import { cc as UIActionTriggerCreate } from './controller-CfSLTEhH.js'; -import { bA as UIButtonElement } from './controller-CfSLTEhH.js'; -import { bB as UIButtonElementCreate } from './controller-CfSLTEhH.js'; -import { bC as UIButtonElementUpdate } from './controller-CfSLTEhH.js'; -import { bY as UIButtonRowElement } from './controller-CfSLTEhH.js'; -import { bZ as UIButtonRowElementCreate } from './controller-CfSLTEhH.js'; -import { b_ as UIButtonRowElementUpdate } from './controller-CfSLTEhH.js'; -import { b$ as UICheckboxGroupElement } from './controller-CfSLTEhH.js'; -import { c0 as UICheckboxGroupElementCreate } from './controller-CfSLTEhH.js'; -import { c1 as UICheckboxGroupElementUpdate } from './controller-CfSLTEhH.js'; -import { cb as UIControlElementOption } from './controller-CfSLTEhH.js'; -import { cd as UiController } from './controller-CfSLTEhH.js'; -import { U as UiControlsOptions } from './controller-CfSLTEhH.js'; -import { bJ as UIDividerElement } from './controller-CfSLTEhH.js'; -import { bK as UIDividerElementCreate } from './controller-CfSLTEhH.js'; -import { bL as UIDividerElementUpdate } from './controller-CfSLTEhH.js'; -import { bG as UIFlexibleSpaceElement } from './controller-CfSLTEhH.js'; -import { bH as UIFlexibleSpaceElementCreate } from './controller-CfSLTEhH.js'; -import { bI as UIFlexibleSpaceElementUpdate } from './controller-CfSLTEhH.js'; -import { bV as UIGridContainerElement } from './controller-CfSLTEhH.js'; -import { bW as UIGridContainerElementCreate } from './controller-CfSLTEhH.js'; -import { bX as UIGridContainerElementUpdate } from './controller-CfSLTEhH.js'; -import { c8 as UIIframeElement } from './controller-CfSLTEhH.js'; -import { c9 as UIIframeElementCreate } from './controller-CfSLTEhH.js'; -import { ca as UIIframeElementUpdate } from './controller-CfSLTEhH.js'; -import { by as UIPanel } from './controller-CfSLTEhH.js'; -import { bz as UIPanelCreateOrUpdate } from './controller-CfSLTEhH.js'; -import { bS as UIPanelElement } from './controller-CfSLTEhH.js'; -import { bT as UIPanelElementCreate } from './controller-CfSLTEhH.js'; -import { bU as UIPanelElementUpdate } from './controller-CfSLTEhH.js'; -import { c2 as UIRadioGroupElement } from './controller-CfSLTEhH.js'; -import { c3 as UIRadioGroupElementCreate } from './controller-CfSLTEhH.js'; -import { c4 as UIRadioGroupElementUpdate } from './controller-CfSLTEhH.js'; -import { bP as UISelectElement } from './controller-CfSLTEhH.js'; -import { bQ as UISelectElementCreate } from './controller-CfSLTEhH.js'; -import { bR as UISelectElementUpdate } from './controller-CfSLTEhH.js'; -import { bD as UITextElement } from './controller-CfSLTEhH.js'; -import { bE as UITextElementCreate } from './controller-CfSLTEhH.js'; -import { bF as UITextElementUpdate } from './controller-CfSLTEhH.js'; -import { bM as UITextInputElement } from './controller-CfSLTEhH.js'; -import { bN as UITextInputElementCreate } from './controller-CfSLTEhH.js'; -import { bO as UITextInputElementUpdate } from './controller-CfSLTEhH.js'; -import { c5 as UIToggleGroupElement } from './controller-CfSLTEhH.js'; -import { c6 as UIToggleGroupElementCreate } from './controller-CfSLTEhH.js'; -import { c7 as UIToggleGroupElementUpdate } from './controller-CfSLTEhH.js'; -import { bv as UpdateActionTriggerParams } from './controller-CfSLTEhH.js'; -import { ac as UpdateLayerParams } from './controller-CfSLTEhH.js'; -import { bw as UpdatePanelElementsParams } from './controller-CfSLTEhH.js'; -import { aJ as ValueConfiguration } from './controller-CfSLTEhH.js'; -import { ad as VectorLayer } from './controller-CfSLTEhH.js'; -import { V as ViewportCenterZoom } from './controller-CfSLTEhH.js'; -import { cf as ViewportConstraints } from './controller-CfSLTEhH.js'; -import { ci as ViewportController } from './controller-CfSLTEhH.js'; -import { cg as ViewportFitBoundsParams } from './controller-CfSLTEhH.js'; -import { ch as ViewportState } from './controller-CfSLTEhH.js'; -import { z } from './controller-CfSLTEhH.js'; +import { av as AggregatedGridConfig } from './controller-DItYvwe0.js'; +import { aw as AggregationConfig } from './controller-DItYvwe0.js'; +import { ax as AggregationMethod } from './controller-DItYvwe0.js'; +import { C as CircleElementCreate } from './controller-DItYvwe0.js'; +import { a as CircleElementRead } from './controller-DItYvwe0.js'; +import { b as CircleElementUpdate } from './controller-DItYvwe0.js'; +import { b9 as CircleToolSettings } from './controller-DItYvwe0.js'; +import { ba as ConfigurableToolType } from './controller-DItYvwe0.js'; +import { ay as CountGridConfig } from './controller-DItYvwe0.js'; +import { bq as CreateActionTriggerParams } from './controller-DItYvwe0.js'; +import { K as CreateLayersFromGeoJsonParams } from './controller-DItYvwe0.js'; +import { br as CreateOrUpdatePanelParams } from './controller-DItYvwe0.js'; +import { bs as CreatePanelElementsParams } from './controller-DItYvwe0.js'; +import { O as DataOnlyLayer } from './controller-DItYvwe0.js'; +import { bt as DeletePanelElementsParams } from './controller-DItYvwe0.js'; +import { E as Element_2 } from './controller-DItYvwe0.js'; +import { c as ElementChangeCallbackParams } from './controller-DItYvwe0.js'; +import { d as ElementCreate } from './controller-DItYvwe0.js'; +import { e as ElementGroup } from './controller-DItYvwe0.js'; +import { f as ElementGroupChangeCallbackParams } from './controller-DItYvwe0.js'; +import { aN as ElementGroupNode } from './controller-DItYvwe0.js'; +import { aO as ElementNode } from './controller-DItYvwe0.js'; +import { B as ElementsController } from './controller-DItYvwe0.js'; +import { g as ElementUpdate } from './controller-DItYvwe0.js'; +import { aP as EntityNode } from './controller-DItYvwe0.js'; +import { aQ as FeatureNode } from './controller-DItYvwe0.js'; +import { aR as FeatureSelection } from './controller-DItYvwe0.js'; +import { aV as FeltBoundary } from './controller-DItYvwe0.js'; +import { F as FeltController } from './controller-DItYvwe0.js'; +import { Q as FeltTiledVectorSource } from './controller-DItYvwe0.js'; +import { aW as FeltZoom } from './controller-DItYvwe0.js'; +import { ao as FilterExpression } from './controller-DItYvwe0.js'; +import { ap as FilterLogicGate } from './controller-DItYvwe0.js'; +import { ar as Filters } from './controller-DItYvwe0.js'; +import { aq as FilterTernary } from './controller-DItYvwe0.js'; +import { R as GeoJsonDataVectorSource } from './controller-DItYvwe0.js'; +import { aX as GeoJsonFeature } from './controller-DItYvwe0.js'; +import { S as GeoJsonFileVectorSource } from './controller-DItYvwe0.js'; +import { aY as GeoJsonGeometry } from './controller-DItYvwe0.js'; +import { aZ as GeoJsonProperties } from './controller-DItYvwe0.js'; +import { W as GeoJsonUrlVectorSource } from './controller-DItYvwe0.js'; +import { as as GeometryFilter } from './controller-DItYvwe0.js'; +import { G as GetElementGroupsConstraint } from './controller-DItYvwe0.js'; +import { h as GetElementsConstraint } from './controller-DItYvwe0.js'; +import { az as GetLayerCalculationParams } from './controller-DItYvwe0.js'; +import { aA as GetLayerCategoriesGroup } from './controller-DItYvwe0.js'; +import { aB as GetLayerCategoriesParams } from './controller-DItYvwe0.js'; +import { X as GetLayerGroupsConstraint } from './controller-DItYvwe0.js'; +import { aC as GetLayerHistogramBin } from './controller-DItYvwe0.js'; +import { aD as GetLayerHistogramParams } from './controller-DItYvwe0.js'; +import { aE as GetLayerPrecomputedCalculationParams } from './controller-DItYvwe0.js'; +import { Y as GetLayersConstraint } from './controller-DItYvwe0.js'; +import { Z as GetRenderedFeaturesConstraint } from './controller-DItYvwe0.js'; +import { aF as GridConfig } from './controller-DItYvwe0.js'; +import { aG as GridType } from './controller-DItYvwe0.js'; +import { H as HighlighterElementCreate } from './controller-DItYvwe0.js'; +import { i as HighlighterElementRead } from './controller-DItYvwe0.js'; +import { j as HighlighterElementUpdate } from './controller-DItYvwe0.js'; +import { bb as HighlighterToolSettings } from './controller-DItYvwe0.js'; +import { I as ImageElementCreate } from './controller-DItYvwe0.js'; +import { k as ImageElementRead } from './controller-DItYvwe0.js'; +import { l as ImageElementUpdate } from './controller-DItYvwe0.js'; +import { bc as InputToolSettings } from './controller-DItYvwe0.js'; +import { J as InteractionsController } from './controller-DItYvwe0.js'; +import { a_ as LatLng } from './controller-DItYvwe0.js'; +import { _ as Layer } from './controller-DItYvwe0.js'; +import { at as LayerBoundaries } from './controller-DItYvwe0.js'; +import { $ as LayerChangeCallbackParams } from './controller-DItYvwe0.js'; +import { a0 as LayerCommon } from './controller-DItYvwe0.js'; +import { ae as LayerFeature } from './controller-DItYvwe0.js'; +import { au as LayerFilters } from './controller-DItYvwe0.js'; +import { a1 as LayerGroup } from './controller-DItYvwe0.js'; +import { a2 as LayerGroupChangeCallbackParams } from './controller-DItYvwe0.js'; +import { aS as LayerGroupNode } from './controller-DItYvwe0.js'; +import { aT as LayerNode } from './controller-DItYvwe0.js'; +import { a3 as LayerProcessingStatus } from './controller-DItYvwe0.js'; +import { ag as LayerSchema } from './controller-DItYvwe0.js'; +import { ah as LayerSchemaAttribute } from './controller-DItYvwe0.js'; +import { ai as LayerSchemaBooleanAttribute } from './controller-DItYvwe0.js'; +import { aj as LayerSchemaCommonAttribute } from './controller-DItYvwe0.js'; +import { ak as LayerSchemaDateAttribute } from './controller-DItYvwe0.js'; +import { al as LayerSchemaDateTimeAttribute } from './controller-DItYvwe0.js'; +import { am as LayerSchemaNumericAttribute } from './controller-DItYvwe0.js'; +import { an as LayerSchemaTextAttribute } from './controller-DItYvwe0.js'; +import { aK as LayersController } from './controller-DItYvwe0.js'; +import { a4 as LegendDisplay } from './controller-DItYvwe0.js'; +import { a5 as LegendItem } from './controller-DItYvwe0.js'; +import { a6 as LegendItemChangeCallbackParams } from './controller-DItYvwe0.js'; +import { a7 as LegendItemIdentifier } from './controller-DItYvwe0.js'; +import { a8 as LegendItemsConstraint } from './controller-DItYvwe0.js'; +import { a$ as LineStringGeometry } from './controller-DItYvwe0.js'; +import { bd as LineToolSettings } from './controller-DItYvwe0.js'; +import { L as LinkElementRead } from './controller-DItYvwe0.js'; +import { b0 as LngLatTuple } from './controller-DItYvwe0.js'; +import { aL as MapDetails } from './controller-DItYvwe0.js'; +import { D as MapInteractionEvent } from './controller-DItYvwe0.js'; +import { M as MarkerElementCreate } from './controller-DItYvwe0.js'; +import { m as MarkerElementRead } from './controller-DItYvwe0.js'; +import { n as MarkerElementUpdate } from './controller-DItYvwe0.js'; +import { be as MarkerToolSettings } from './controller-DItYvwe0.js'; +import { aM as MiscController } from './controller-DItYvwe0.js'; +import { aH as MultiAggregationConfig } from './controller-DItYvwe0.js'; +import { b1 as MultiLineStringGeometry } from './controller-DItYvwe0.js'; +import { b2 as MultiPointGeometry } from './controller-DItYvwe0.js'; +import { b3 as MultiPolygonGeometry } from './controller-DItYvwe0.js'; +import { N as NoteElementCreate } from './controller-DItYvwe0.js'; +import { o as NoteElementRead } from './controller-DItYvwe0.js'; +import { p as NoteElementUpdate } from './controller-DItYvwe0.js'; +import { bf as NoteToolSettings } from './controller-DItYvwe0.js'; +import { bu as OnMapInteractionsOptions } from './controller-DItYvwe0.js'; +import { P as PathElementCreate } from './controller-DItYvwe0.js'; +import { q as PathElementRead } from './controller-DItYvwe0.js'; +import { r as PathElementUpdate } from './controller-DItYvwe0.js'; +import { bg as PinToolSettings } from './controller-DItYvwe0.js'; +import { s as PlaceElementCreate } from './controller-DItYvwe0.js'; +import { t as PlaceElementRead } from './controller-DItYvwe0.js'; +import { u as PlaceElementUpdate } from './controller-DItYvwe0.js'; +import { bh as PlaceFrame } from './controller-DItYvwe0.js'; +import { bx as PlacementForUIElement } from './controller-DItYvwe0.js'; +import { bi as PlaceSymbol } from './controller-DItYvwe0.js'; +import { b4 as PointGeometry } from './controller-DItYvwe0.js'; +import { v as PolygonElementCreate } from './controller-DItYvwe0.js'; +import { w as PolygonElementRead } from './controller-DItYvwe0.js'; +import { x as PolygonElementUpdate } from './controller-DItYvwe0.js'; +import { b5 as PolygonGeometry } from './controller-DItYvwe0.js'; +import { bj as PolygonToolSettings } from './controller-DItYvwe0.js'; +import { aI as PrecomputedAggregationMethod } from './controller-DItYvwe0.js'; +import { a9 as RasterBand } from './controller-DItYvwe0.js'; +import { aa as RasterLayer } from './controller-DItYvwe0.js'; +import { ab as RasterLayerSource } from './controller-DItYvwe0.js'; +import { af as RasterValue } from './controller-DItYvwe0.js'; +import { bk as RouteToolSettings } from './controller-DItYvwe0.js'; +import { aU as SelectionController } from './controller-DItYvwe0.js'; +import { ce as SetViewportCenterZoomParams } from './controller-DItYvwe0.js'; +import { b6 as SetVisibilityRequest } from './controller-DItYvwe0.js'; +import { b7 as SortConfig } from './controller-DItYvwe0.js'; +import { b8 as SortDirection } from './controller-DItYvwe0.js'; +import { T as TextElementCreate } from './controller-DItYvwe0.js'; +import { y as TextElementRead } from './controller-DItYvwe0.js'; +import { A as TextElementUpdate } from './controller-DItYvwe0.js'; +import { bl as TextToolSettings } from './controller-DItYvwe0.js'; +import { bp as ToolsController } from './controller-DItYvwe0.js'; +import { bm as ToolSettingsChangeEvent } from './controller-DItYvwe0.js'; +import { bn as ToolSettingsMap } from './controller-DItYvwe0.js'; +import { bo as ToolType } from './controller-DItYvwe0.js'; +import { cc as UIActionTriggerCreate } from './controller-DItYvwe0.js'; +import { bA as UIButtonElement } from './controller-DItYvwe0.js'; +import { bB as UIButtonElementCreate } from './controller-DItYvwe0.js'; +import { bC as UIButtonElementUpdate } from './controller-DItYvwe0.js'; +import { bY as UIButtonRowElement } from './controller-DItYvwe0.js'; +import { bZ as UIButtonRowElementCreate } from './controller-DItYvwe0.js'; +import { b_ as UIButtonRowElementUpdate } from './controller-DItYvwe0.js'; +import { b$ as UICheckboxGroupElement } from './controller-DItYvwe0.js'; +import { c0 as UICheckboxGroupElementCreate } from './controller-DItYvwe0.js'; +import { c1 as UICheckboxGroupElementUpdate } from './controller-DItYvwe0.js'; +import { cb as UIControlElementOption } from './controller-DItYvwe0.js'; +import { cd as UiController } from './controller-DItYvwe0.js'; +import { U as UiControlsOptions } from './controller-DItYvwe0.js'; +import { bJ as UIDividerElement } from './controller-DItYvwe0.js'; +import { bK as UIDividerElementCreate } from './controller-DItYvwe0.js'; +import { bL as UIDividerElementUpdate } from './controller-DItYvwe0.js'; +import { bG as UIFlexibleSpaceElement } from './controller-DItYvwe0.js'; +import { bH as UIFlexibleSpaceElementCreate } from './controller-DItYvwe0.js'; +import { bI as UIFlexibleSpaceElementUpdate } from './controller-DItYvwe0.js'; +import { bV as UIGridContainerElement } from './controller-DItYvwe0.js'; +import { bW as UIGridContainerElementCreate } from './controller-DItYvwe0.js'; +import { bX as UIGridContainerElementUpdate } from './controller-DItYvwe0.js'; +import { c8 as UIIframeElement } from './controller-DItYvwe0.js'; +import { c9 as UIIframeElementCreate } from './controller-DItYvwe0.js'; +import { ca as UIIframeElementUpdate } from './controller-DItYvwe0.js'; +import { by as UIPanel } from './controller-DItYvwe0.js'; +import { bz as UIPanelCreateOrUpdate } from './controller-DItYvwe0.js'; +import { bS as UIPanelElement } from './controller-DItYvwe0.js'; +import { bT as UIPanelElementCreate } from './controller-DItYvwe0.js'; +import { bU as UIPanelElementUpdate } from './controller-DItYvwe0.js'; +import { c2 as UIRadioGroupElement } from './controller-DItYvwe0.js'; +import { c3 as UIRadioGroupElementCreate } from './controller-DItYvwe0.js'; +import { c4 as UIRadioGroupElementUpdate } from './controller-DItYvwe0.js'; +import { bP as UISelectElement } from './controller-DItYvwe0.js'; +import { bQ as UISelectElementCreate } from './controller-DItYvwe0.js'; +import { bR as UISelectElementUpdate } from './controller-DItYvwe0.js'; +import { bD as UITextElement } from './controller-DItYvwe0.js'; +import { bE as UITextElementCreate } from './controller-DItYvwe0.js'; +import { bF as UITextElementUpdate } from './controller-DItYvwe0.js'; +import { bM as UITextInputElement } from './controller-DItYvwe0.js'; +import { bN as UITextInputElementCreate } from './controller-DItYvwe0.js'; +import { bO as UITextInputElementUpdate } from './controller-DItYvwe0.js'; +import { c5 as UIToggleGroupElement } from './controller-DItYvwe0.js'; +import { c6 as UIToggleGroupElementCreate } from './controller-DItYvwe0.js'; +import { c7 as UIToggleGroupElementUpdate } from './controller-DItYvwe0.js'; +import { bv as UpdateActionTriggerParams } from './controller-DItYvwe0.js'; +import { ac as UpdateLayerParams } from './controller-DItYvwe0.js'; +import { bw as UpdatePanelElementsParams } from './controller-DItYvwe0.js'; +import { aJ as ValueConfiguration } from './controller-DItYvwe0.js'; +import { ad as VectorLayer } from './controller-DItYvwe0.js'; +import { V as ViewportCenterZoom } from './controller-DItYvwe0.js'; +import { cf as ViewportConstraints } from './controller-DItYvwe0.js'; +import { ci as ViewportController } from './controller-DItYvwe0.js'; +import { cg as ViewportFitBoundsParams } from './controller-DItYvwe0.js'; +import { ch as ViewportState } from './controller-DItYvwe0.js'; +import { z } from './controller-DItYvwe0.js'; import { z as z_2 } from 'zod'; export { AggregatedGridConfig } diff --git a/package-lock.json b/package-lock.json index 931ba28a..c2bbc12c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@feltmaps/js-sdk", - "version": "1.6.0", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@feltmaps/js-sdk", - "version": "1.6.0", + "version": "1.9.0", "license": "MIT", "devDependencies": { "@arethetypeswrong/cli": "^0.17.4", diff --git a/src/modules/layers/controller.ts b/src/modules/layers/controller.ts index 9f4f4842..78707790 100644 --- a/src/modules/layers/controller.ts +++ b/src/modules/layers/controller.ts @@ -62,6 +62,7 @@ export const layersController = ( ), updateLayer: method(feltWindow, "updateLayer", convertFileSourceToDataSource), deleteLayer: method(feltWindow, "deleteLayer"), + duplicateLayer: method(feltWindow, "duplicateLayer"), // groups getLayerGroup: method(feltWindow, "getLayerGroup"), @@ -345,6 +346,19 @@ export interface LayersController { */ deleteLayer(id: string): Promise; + /** + * Duplicate a layer from the map by its id. + * + * @remarks This will create an ephemeral copy of the layer, just for the duration of the session. The duplicated layer will not be persisted to the map. + * + * @example + * ```typescript + * const duplicatedLayer = await felt.duplicateLayer("layer-1"); + * ``` + * @returns The duplicated layer. + */ + duplicateLayer(id: string): Promise; + // GROUPS /** diff --git a/src/modules/layers/schema.ts b/src/modules/layers/schema.ts index 79748bd4..3d08fb49 100644 --- a/src/modules/layers/schema.ts +++ b/src/modules/layers/schema.ts @@ -68,6 +68,8 @@ const UpdateLayerMessage = methodMessage("updateLayer", UpdateLayerSchema); const DeleteLayerMessage = methodMessage("deleteLayer", z.string()); +const DuplicateLayerMessage = methodMessage("duplicateLayer", z.string()); + // LAYER GROUPS const GetGroupMessage = methodMessage("getLayerGroup", z.string()); const GetGroupsMessage = methodMessage( @@ -209,7 +211,7 @@ export const layersSchema = { CreateLayersFromGeoJsonMessage, DeleteLayerMessage, UpdateLayerMessage, - + DuplicateLayerMessage, GetGroupMessage, GetGroupsMessage, SetLayerGroupVisibilityMessage, @@ -261,7 +263,7 @@ export type LayersSchema = { >; updateLayer: Method>; deleteLayer: Method>; - + duplicateLayer: Method>; getLayerGroup: Method>; getLayerGroups: Method>; setLayerGroupVisibility: Method<