From 17d409228ffc860dccfa74ba4e414b10b78fa344 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Mon, 17 Mar 2025 13:28:31 +0100 Subject: [PATCH 1/2] docs(changeset): Add coordinates to circle --- .changeset/small-buckets-turn.md | 5 +++++ docs/Elements/CircleElementRead.md | 6 ++++++ src/modules/elements/types.ts | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/small-buckets-turn.md diff --git a/.changeset/small-buckets-turn.md b/.changeset/small-buckets-turn.md new file mode 100644 index 0000000..e3a1f2b --- /dev/null +++ b/.changeset/small-buckets-turn.md @@ -0,0 +1,5 @@ +--- +"@feltmaps/js-sdk": minor +--- + +Add coordinates to circle diff --git a/docs/Elements/CircleElementRead.md b/docs/Elements/CircleElementRead.md index 68210a2..72114bb 100644 --- a/docs/Elements/CircleElementRead.md +++ b/docs/Elements/CircleElementRead.md @@ -68,6 +68,12 @@ *** +## coordinates + +> **coordinates**: \[`number`, `number`] = `LngLatTupleSchema` + +*** + ## radius > **radius**: `number` diff --git a/src/modules/elements/types.ts b/src/modules/elements/types.ts index 1ef4eeb..ca5347b 100644 --- a/src/modules/elements/types.ts +++ b/src/modules/elements/types.ts @@ -194,7 +194,7 @@ const PathReadSchema = PathElementSchema.omit({ coordinates: true }); const PolygonReadSchema = PolygonElementSchema.omit({ coordinates: true, }); -const CircleReadSchema = CircleElementSchema.omit({ coordinates: true }); +const CircleReadSchema = CircleElementSchema; const MarkerReadSchema = MarkerElementSchema.omit({ coordinates: true }); const HighlighterReadSchema = HighlighterElementSchema.omit({ coordinates: true, From 6a8b375649a0f123cfe324526af696ca93bda4c5 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Tue, 18 Mar 2025 09:53:47 +0100 Subject: [PATCH 2/2] Return coords when reading a place --- .changeset/small-buckets-turn.md | 2 +- docs/Elements/PlaceElementRead.md | 6 + etc/js-sdk.api.md | 212 +++++++++++++++--------------- src/modules/elements/types.ts | 2 +- 4 files changed, 114 insertions(+), 108 deletions(-) diff --git a/.changeset/small-buckets-turn.md b/.changeset/small-buckets-turn.md index e3a1f2b..73888c0 100644 --- a/.changeset/small-buckets-turn.md +++ b/.changeset/small-buckets-turn.md @@ -2,4 +2,4 @@ "@feltmaps/js-sdk": minor --- -Add coordinates to circle +Return coordinates on Circle and Place elements as they are only a single point. diff --git a/docs/Elements/PlaceElementRead.md b/docs/Elements/PlaceElementRead.md index c9c1eeb..4ad9472 100644 --- a/docs/Elements/PlaceElementRead.md +++ b/docs/Elements/PlaceElementRead.md @@ -50,6 +50,12 @@ *** +## coordinates + +> **coordinates**: \[`number`, `number`] = `PointGeometrySchema.shape.coordinates` + +*** + ## symbol > **symbol**: `string` diff --git a/etc/js-sdk.api.md b/etc/js-sdk.api.md index 799c0e2..15e48f6 100644 --- a/etc/js-sdk.api.md +++ b/etc/js-sdk.api.md @@ -4,112 +4,112 @@ ```ts -import { ao as AggregationConfig } from './types-jcotMzEv.js'; -import { A as AggregationMethod } from './types-jcotMzEv.js'; -import { Q as CircleElementCreate } from './types-jcotMzEv.js'; -import { R as CircleElementRead } from './types-jcotMzEv.js'; -import { U as CircleElementUpdate } from './types-jcotMzEv.js'; -import { aF as CircleToolSettings } from './types-jcotMzEv.js'; -import { C as ConfigurableToolType } from './types-jcotMzEv.js'; -import { E as Element_2 } from './types-jcotMzEv.js'; -import { d as ElementChangeCallbackParams } from './types-jcotMzEv.js'; -import { f as ElementCreate } from './types-jcotMzEv.js'; -import { b as ElementGroup } from './types-jcotMzEv.js'; -import { e as ElementGroupChangeCallbackParams } from './types-jcotMzEv.js'; -import { ar as ElementGroupNode } from './types-jcotMzEv.js'; -import { as as ElementNode } from './types-jcotMzEv.js'; -import { g as ElementUpdate } from './types-jcotMzEv.js'; -import { z as EntityNode } from './types-jcotMzEv.js'; -import { s as Feature } from './types-jcotMzEv.js'; -import { at as FeatureNode } from './types-jcotMzEv.js'; -import { B as FeatureSelection } from './types-jcotMzEv.js'; -import { aw as FeltBoundary } from './types-jcotMzEv.js'; -import { ax as FeltZoom } from './types-jcotMzEv.js'; -import { al as FilterExpression } from './types-jcotMzEv.js'; -import { am as FilterLogicGate } from './types-jcotMzEv.js'; -import { F as Filters } from './types-jcotMzEv.js'; -import { an as FilterTernary } from './types-jcotMzEv.js'; -import { G as Geometry } from './types-jcotMzEv.js'; -import { c as GetElementGroupsConstraint } from './types-jcotMzEv.js'; -import { a as GetElementsConstraint } from './types-jcotMzEv.js'; -import { x as GetLayerCalculationParams } from './types-jcotMzEv.js'; -import { u as GetLayerCategoriesGroup } from './types-jcotMzEv.js'; -import { t as GetLayerCategoriesParams } from './types-jcotMzEv.js'; -import { k as GetLayerGroupsConstraint } from './types-jcotMzEv.js'; -import { w as GetLayerHistogramBin } from './types-jcotMzEv.js'; -import { v as GetLayerHistogramParams } from './types-jcotMzEv.js'; -import { h as GetLayersConstraint } from './types-jcotMzEv.js'; -import { r as GetRenderedFeaturesConstraint } from './types-jcotMzEv.js'; -import { W as HighlighterElementCreate } from './types-jcotMzEv.js'; -import { X as HighlighterElementRead } from './types-jcotMzEv.js'; -import { Y as HighlighterElementUpdate } from './types-jcotMzEv.js'; -import { aG as HighlighterToolSettings } from './types-jcotMzEv.js'; -import { Z as ImageElementCreate } from './types-jcotMzEv.js'; -import { _ as ImageElementRead } from './types-jcotMzEv.js'; -import { $ as ImageElementUpdate } from './types-jcotMzEv.js'; -import { I as InputToolSettings } from './types-jcotMzEv.js'; -import { J } from './types-jcotMzEv.js'; -import { ay as LatLng } from './types-jcotMzEv.js'; -import { L as Layer } from './types-jcotMzEv.js'; -import { i as LayerChangeCallbackParams } from './types-jcotMzEv.js'; -import { q as LayerFilters } from './types-jcotMzEv.js'; -import { j as LayerGroup } from './types-jcotMzEv.js'; -import { l as LayerGroupChangeCallbackParams } from './types-jcotMzEv.js'; -import { au as LayerGroupNode } from './types-jcotMzEv.js'; -import { av as LayerNode } from './types-jcotMzEv.js'; -import { aj as LayerProcessingStatus } from './types-jcotMzEv.js'; -import { n as LegendItem } from './types-jcotMzEv.js'; -import { p as LegendItemChangeCallbackParams } from './types-jcotMzEv.js'; -import { m as LegendItemIdentifier } from './types-jcotMzEv.js'; -import { o as LegendItemsConstraint } from './types-jcotMzEv.js'; -import { az as LineStringGeometry } from './types-jcotMzEv.js'; -import { aH as LineToolSettings } from './types-jcotMzEv.js'; -import { a0 as LinkElementRead } from './types-jcotMzEv.js'; -import { aA as LngLatTuple } from './types-jcotMzEv.js'; -import { y as MapDetails } from './types-jcotMzEv.js'; -import { M as MapInteractionEvent } from './types-jcotMzEv.js'; -import { a1 as MarkerElementCreate } from './types-jcotMzEv.js'; -import { a2 as MarkerElementRead } from './types-jcotMzEv.js'; -import { a3 as MarkerElementUpdate } from './types-jcotMzEv.js'; -import { aI as MarkerToolSettings } from './types-jcotMzEv.js'; -import { ap as MultiAggregationConfig } from './types-jcotMzEv.js'; -import { aB as MultiLineStringGeometry } from './types-jcotMzEv.js'; -import { aC as MultiPolygonGeometry } from './types-jcotMzEv.js'; -import { a4 as NoteElementCreate } from './types-jcotMzEv.js'; -import { a5 as NoteElementRead } from './types-jcotMzEv.js'; -import { a6 as NoteElementUpdate } from './types-jcotMzEv.js'; -import { aJ as NoteToolSettings } from './types-jcotMzEv.js'; -import { a7 as PathElementCreate } from './types-jcotMzEv.js'; -import { a8 as PathElementRead } from './types-jcotMzEv.js'; -import { a9 as PathElementUpdate } from './types-jcotMzEv.js'; -import { aK as PinToolSettings } from './types-jcotMzEv.js'; -import { aa as PlaceElementCreate } from './types-jcotMzEv.js'; -import { ab as PlaceElementRead } from './types-jcotMzEv.js'; -import { ac as PlaceElementUpdate } from './types-jcotMzEv.js'; -import { aL as PlaceFrame } from './types-jcotMzEv.js'; -import { aM as PlaceSymbol } from './types-jcotMzEv.js'; -import { aD as PointGeometry } from './types-jcotMzEv.js'; -import { ad as PolygonElementCreate } from './types-jcotMzEv.js'; -import { ae as PolygonElementRead } from './types-jcotMzEv.js'; -import { af as PolygonElementUpdate } from './types-jcotMzEv.js'; -import { aE as PolygonGeometry } from './types-jcotMzEv.js'; -import { aN as PolygonToolSettings } from './types-jcotMzEv.js'; -import { ak as RasterValue } from './types-jcotMzEv.js'; -import { aO as RouteToolSettings } from './types-jcotMzEv.js'; -import { K as SetViewportCenterZoomParams } from './types-jcotMzEv.js'; -import { S as SetVisibilityRequest } from './types-jcotMzEv.js'; -import { ag as TextElementCreate } from './types-jcotMzEv.js'; -import { ah as TextElementRead } from './types-jcotMzEv.js'; -import { ai as TextElementUpdate } from './types-jcotMzEv.js'; -import { aP as TextToolSettings } from './types-jcotMzEv.js'; -import { H as ToolSettingsChangeEvent } from './types-jcotMzEv.js'; -import { D as ToolSettingsMap } from './types-jcotMzEv.js'; -import { T as ToolType } from './types-jcotMzEv.js'; -import { aq as ValueConfiguration } from './types-jcotMzEv.js'; -import { P as ViewportCenterZoom } from './types-jcotMzEv.js'; -import { N as ViewportConstraints } from './types-jcotMzEv.js'; -import { O as ViewportFitBoundsParams } from './types-jcotMzEv.js'; -import { V as ViewportState } from './types-jcotMzEv.js'; +import { ao as AggregationConfig } from './types-NOlNQi4k.js'; +import { A as AggregationMethod } from './types-NOlNQi4k.js'; +import { Q as CircleElementCreate } from './types-NOlNQi4k.js'; +import { R as CircleElementRead } from './types-NOlNQi4k.js'; +import { U as CircleElementUpdate } from './types-NOlNQi4k.js'; +import { aF as CircleToolSettings } from './types-NOlNQi4k.js'; +import { C as ConfigurableToolType } from './types-NOlNQi4k.js'; +import { E as Element_2 } from './types-NOlNQi4k.js'; +import { d as ElementChangeCallbackParams } from './types-NOlNQi4k.js'; +import { f as ElementCreate } from './types-NOlNQi4k.js'; +import { b as ElementGroup } from './types-NOlNQi4k.js'; +import { e as ElementGroupChangeCallbackParams } from './types-NOlNQi4k.js'; +import { ar as ElementGroupNode } from './types-NOlNQi4k.js'; +import { as as ElementNode } from './types-NOlNQi4k.js'; +import { g as ElementUpdate } from './types-NOlNQi4k.js'; +import { z as EntityNode } from './types-NOlNQi4k.js'; +import { s as Feature } from './types-NOlNQi4k.js'; +import { at as FeatureNode } from './types-NOlNQi4k.js'; +import { B as FeatureSelection } from './types-NOlNQi4k.js'; +import { aw as FeltBoundary } from './types-NOlNQi4k.js'; +import { ax as FeltZoom } from './types-NOlNQi4k.js'; +import { al as FilterExpression } from './types-NOlNQi4k.js'; +import { am as FilterLogicGate } from './types-NOlNQi4k.js'; +import { F as Filters } from './types-NOlNQi4k.js'; +import { an as FilterTernary } from './types-NOlNQi4k.js'; +import { G as Geometry } from './types-NOlNQi4k.js'; +import { c as GetElementGroupsConstraint } from './types-NOlNQi4k.js'; +import { a as GetElementsConstraint } from './types-NOlNQi4k.js'; +import { x as GetLayerCalculationParams } from './types-NOlNQi4k.js'; +import { u as GetLayerCategoriesGroup } from './types-NOlNQi4k.js'; +import { t as GetLayerCategoriesParams } from './types-NOlNQi4k.js'; +import { k as GetLayerGroupsConstraint } from './types-NOlNQi4k.js'; +import { w as GetLayerHistogramBin } from './types-NOlNQi4k.js'; +import { v as GetLayerHistogramParams } from './types-NOlNQi4k.js'; +import { h as GetLayersConstraint } from './types-NOlNQi4k.js'; +import { r as GetRenderedFeaturesConstraint } from './types-NOlNQi4k.js'; +import { W as HighlighterElementCreate } from './types-NOlNQi4k.js'; +import { X as HighlighterElementRead } from './types-NOlNQi4k.js'; +import { Y as HighlighterElementUpdate } from './types-NOlNQi4k.js'; +import { aG as HighlighterToolSettings } from './types-NOlNQi4k.js'; +import { Z as ImageElementCreate } from './types-NOlNQi4k.js'; +import { _ as ImageElementRead } from './types-NOlNQi4k.js'; +import { $ as ImageElementUpdate } from './types-NOlNQi4k.js'; +import { I as InputToolSettings } from './types-NOlNQi4k.js'; +import { J } from './types-NOlNQi4k.js'; +import { ay as LatLng } from './types-NOlNQi4k.js'; +import { L as Layer } from './types-NOlNQi4k.js'; +import { i as LayerChangeCallbackParams } from './types-NOlNQi4k.js'; +import { q as LayerFilters } from './types-NOlNQi4k.js'; +import { j as LayerGroup } from './types-NOlNQi4k.js'; +import { l as LayerGroupChangeCallbackParams } from './types-NOlNQi4k.js'; +import { au as LayerGroupNode } from './types-NOlNQi4k.js'; +import { av as LayerNode } from './types-NOlNQi4k.js'; +import { aj as LayerProcessingStatus } from './types-NOlNQi4k.js'; +import { n as LegendItem } from './types-NOlNQi4k.js'; +import { p as LegendItemChangeCallbackParams } from './types-NOlNQi4k.js'; +import { m as LegendItemIdentifier } from './types-NOlNQi4k.js'; +import { o as LegendItemsConstraint } from './types-NOlNQi4k.js'; +import { az as LineStringGeometry } from './types-NOlNQi4k.js'; +import { aH as LineToolSettings } from './types-NOlNQi4k.js'; +import { a0 as LinkElementRead } from './types-NOlNQi4k.js'; +import { aA as LngLatTuple } from './types-NOlNQi4k.js'; +import { y as MapDetails } from './types-NOlNQi4k.js'; +import { M as MapInteractionEvent } from './types-NOlNQi4k.js'; +import { a1 as MarkerElementCreate } from './types-NOlNQi4k.js'; +import { a2 as MarkerElementRead } from './types-NOlNQi4k.js'; +import { a3 as MarkerElementUpdate } from './types-NOlNQi4k.js'; +import { aI as MarkerToolSettings } from './types-NOlNQi4k.js'; +import { ap as MultiAggregationConfig } from './types-NOlNQi4k.js'; +import { aB as MultiLineStringGeometry } from './types-NOlNQi4k.js'; +import { aC as MultiPolygonGeometry } from './types-NOlNQi4k.js'; +import { a4 as NoteElementCreate } from './types-NOlNQi4k.js'; +import { a5 as NoteElementRead } from './types-NOlNQi4k.js'; +import { a6 as NoteElementUpdate } from './types-NOlNQi4k.js'; +import { aJ as NoteToolSettings } from './types-NOlNQi4k.js'; +import { a7 as PathElementCreate } from './types-NOlNQi4k.js'; +import { a8 as PathElementRead } from './types-NOlNQi4k.js'; +import { a9 as PathElementUpdate } from './types-NOlNQi4k.js'; +import { aK as PinToolSettings } from './types-NOlNQi4k.js'; +import { aa as PlaceElementCreate } from './types-NOlNQi4k.js'; +import { ab as PlaceElementRead } from './types-NOlNQi4k.js'; +import { ac as PlaceElementUpdate } from './types-NOlNQi4k.js'; +import { aL as PlaceFrame } from './types-NOlNQi4k.js'; +import { aM as PlaceSymbol } from './types-NOlNQi4k.js'; +import { aD as PointGeometry } from './types-NOlNQi4k.js'; +import { ad as PolygonElementCreate } from './types-NOlNQi4k.js'; +import { ae as PolygonElementRead } from './types-NOlNQi4k.js'; +import { af as PolygonElementUpdate } from './types-NOlNQi4k.js'; +import { aE as PolygonGeometry } from './types-NOlNQi4k.js'; +import { aN as PolygonToolSettings } from './types-NOlNQi4k.js'; +import { ak as RasterValue } from './types-NOlNQi4k.js'; +import { aO as RouteToolSettings } from './types-NOlNQi4k.js'; +import { K as SetViewportCenterZoomParams } from './types-NOlNQi4k.js'; +import { S as SetVisibilityRequest } from './types-NOlNQi4k.js'; +import { ag as TextElementCreate } from './types-NOlNQi4k.js'; +import { ah as TextElementRead } from './types-NOlNQi4k.js'; +import { ai as TextElementUpdate } from './types-NOlNQi4k.js'; +import { aP as TextToolSettings } from './types-NOlNQi4k.js'; +import { H as ToolSettingsChangeEvent } from './types-NOlNQi4k.js'; +import { D as ToolSettingsMap } from './types-NOlNQi4k.js'; +import { T as ToolType } from './types-NOlNQi4k.js'; +import { aq as ValueConfiguration } from './types-NOlNQi4k.js'; +import { P as ViewportCenterZoom } from './types-NOlNQi4k.js'; +import { N as ViewportConstraints } from './types-NOlNQi4k.js'; +import { O as ViewportFitBoundsParams } from './types-NOlNQi4k.js'; +import { V as ViewportState } from './types-NOlNQi4k.js'; import { z } from 'zod'; export { AggregationConfig } diff --git a/src/modules/elements/types.ts b/src/modules/elements/types.ts index ca5347b..f3514e8 100644 --- a/src/modules/elements/types.ts +++ b/src/modules/elements/types.ts @@ -189,7 +189,7 @@ export const ElementCreateSchema = z.discriminatedUnion("type", [ NoteCreateSchema, ]); -const PlaceReadSchema = PlaceElementSchema.omit({ coordinates: true }); +const PlaceReadSchema = PlaceElementSchema; const PathReadSchema = PathElementSchema.omit({ coordinates: true }); const PolygonReadSchema = PolygonElementSchema.omit({ coordinates: true,