@feltmaps/js-sdk 1.7.0-next.1 → 1.7.0-next.11

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.
@@ -4137,315 +4137,6 @@ interface ElementGroupChangeCallbackParams {
4137
4137
  elementGroup: ElementGroup | null;
4138
4138
  }
4139
4139
 
4140
- /**
4141
- * The Elements controller allows you to get information about the elements on the
4142
- * map, and make changes to their visibility.
4143
- *
4144
- * @group Controller
4145
- * @public
4146
- */
4147
- interface ElementsController {
4148
- /**
4149
- * Get a single element from the map by its id.
4150
- *
4151
- * @example
4152
- * ```typescript
4153
- * const element = await felt.getElement("element-1");
4154
- * ```
4155
- * @returns The requested element.
4156
- */
4157
- getElement(
4158
- /**
4159
- * The id of the element you want to get.
4160
- */
4161
- id: string): Promise<Element | null>;
4162
- /**
4163
- * Get the geometry of an element in GeoJSON geometry format.
4164
- *
4165
- * For most element types, the geometry returned is based on the `coordinates`
4166
- * property of the element, with some differences:
4167
- *
4168
- * - For Circle elements, the geometry is a Polygon drawn from the `center` and
4169
- * `radius` properties.
4170
- *
4171
- * - Path elements become MultiLineString geometries.
4172
- *
4173
- * - Marker elements return a MultiLineString of the path traced by the user
4174
- * as they drew the marker. Note that this is not the polygon formed by filled-in
4175
- * "pen" stroke, which doesn't exactly follow the path traced by the user as it
4176
- * is smoothed and interpolated to create a continuous line.
4177
- *
4178
- * - Text, Note and Image elements do not return geometry, so will return `null`.
4179
- *
4180
- *
4181
- * @example
4182
- * ```typescript
4183
- * const geometry = await felt.getElementGeometry("element-1");
4184
- * console.log(geometry?.type, geometry?.coordinates);
4185
- * ```
4186
- */
4187
- getElementGeometry(
4188
- /**
4189
- * The id of the element you want to get the geometry of.
4190
- */
4191
- id: string): Promise<GeoJsonGeometry | null>;
4192
- /**
4193
- * Gets elements from the map, according to the constraints supplied. If no
4194
- * constraints are supplied, all elements will be returned.
4195
- *
4196
- * @remarks The elements in the map, ordered by the order specified in Felt. This is not
4197
- * necessarily the order that they are drawn in, as Felt draws points above
4198
- * lines and lines above polygons, for instance.
4199
- *
4200
- * @example
4201
- * ```typescript
4202
- * const elements = await felt.getElements();
4203
- * ```
4204
- * @returns All elements on the map.
4205
- */
4206
- getElements(
4207
- /**
4208
- * The constraints to apply to the elements returned from the map.
4209
- */
4210
- constraint?: GetElementsConstraint): Promise<Array<Element | null>>;
4211
- /**
4212
- * Get an element group from the map by its id.
4213
- *
4214
- * @example
4215
- * ```typescript
4216
- * const elementGroup = await felt.getElementGroup("element-group-1");
4217
- * ```
4218
- * @returns The requested element group.
4219
- */
4220
- getElementGroup(id: string): Promise<ElementGroup | null>;
4221
- /**
4222
- * Gets element groups from the map, according to the filters supplied. If no
4223
- * constraints are supplied, all element groups will be returned in rendering order.
4224
- *
4225
- * @example
4226
- * ```typescript
4227
- * const elementGroups = await felt.getElementGroups({ ids: ["element-group-1", "element-group-2"] });
4228
- * ```
4229
- * @returns The requested element groups.
4230
- */
4231
- getElementGroups(
4232
- /**
4233
- * The constraints to apply to the element groups returned from the map.
4234
- */
4235
- constraint?: GetElementGroupsConstraint): Promise<Array<ElementGroup | null>>;
4236
- /**
4237
- * Hide or show element groups with the given ids.
4238
- *
4239
- * @example
4240
- * ```typescript
4241
- * felt.setElementGroupVisibility({ show: ["element-group-1", "element-group-2"], hide: ["element-group-3"] });
4242
- * ```
4243
- */
4244
- setElementGroupVisibility(visibility: SetVisibilityRequest): Promise<void>;
4245
- /**
4246
- * Adds a listener for when an element is created.
4247
- *
4248
- * @returns A function to unsubscribe from the listener
4249
- *
4250
- * @event
4251
- * @example
4252
- * ```typescript
4253
- * const unsubscribe = felt.onElementCreate({
4254
- * handler: (element) => console.log(element.id),
4255
- * });
4256
- *
4257
- * // later on...
4258
- * unsubscribe();
4259
- * ```
4260
- */
4261
- onElementCreate(args: {
4262
- /**
4263
- * The handler that is called when an element is created.
4264
- *
4265
- * This will fire when elements are created programatically, or when the
4266
- * user starts creating an element with a drawing tool.
4267
- *
4268
- * When the user creates an element with a drawing tool, it can begin in
4269
- * an invalid state, such as if you've just placed a single point in a polygon.
4270
- *
4271
- * You can use the `isBeingCreated` property to determine if the element is
4272
- * still being created by a drawing tool.
4273
- *
4274
- * If you want to know when the element is finished being created, you can
4275
- * use the {@link ElementsController.onElementCreateEnd | `onElementCreateEnd`} listener.
4276
- *
4277
- * @param change - An object describing the change that occurred.
4278
- */
4279
- handler: (change: ElementChangeCallbackParams) => void;
4280
- }): VoidFunction;
4281
- /**
4282
- * Listens for when a new element is finished being created by a drawing tool.
4283
- *
4284
- * This differs from the {@link ElementsController.onElementCreate | `onElementCreate`} listener, which fires whenever an
4285
- * element is first created. This fires when the user finishes creating an element
4286
- * which could be after a series of interactions.
4287
- *
4288
- * For example, when creating a polygon, the user places a series of points then
4289
- * finishes by pressing Enter or Escape. Or when creating a Place element, they
4290
- * add the marker, type a label, then finally deselect the element.
4291
- *
4292
- * @returns A function to unsubscribe from the listener
4293
- *
4294
- * @event
4295
- * @example
4296
- * ```typescript
4297
- * const unsubscribe = felt.onToolCreatedElement({
4298
- * handler: (params) => console.log(params),
4299
- * });
4300
- *
4301
- * // later on...
4302
- * unsubscribe();
4303
- * ```
4304
- */
4305
- onElementCreateEnd(args: {
4306
- /**
4307
- * The handler to call whenever this event fires.
4308
- *
4309
- * @param params - An object containing the element that was created.
4310
- */
4311
- handler: (params: {
4312
- element: Element;
4313
- }) => void;
4314
- }): VoidFunction;
4315
- /**
4316
- * Adds a listener for when an element changes.
4317
- *
4318
- * This will fire when an element is being edited, either on the map by the user
4319
- * or programatically.
4320
- *
4321
- * Like the {@link ElementsController.onElementCreate | `onElementCreate`} listener, this will fire when an element is
4322
- * still being created by a drawing tool.
4323
- *
4324
- * You can check the {@link ElementChangeCallbackParams.isBeingCreated | `isBeingCreated`} property to determine if the element is
4325
- * still being created by a drawing tool.
4326
- *
4327
- * @returns A function to unsubscribe from the listener
4328
- *
4329
- * @event
4330
- * @example
4331
- * ```typescript
4332
- * const unsubscribe = felt.onElementChange({
4333
- * options: { id: "element-1" },
4334
- * handler: ({element}) => console.log(element.id),
4335
- * });
4336
- *
4337
- * // later on...
4338
- * unsubscribe();
4339
- * ```
4340
- */
4341
- onElementChange(args: {
4342
- options: {
4343
- /**
4344
- * The id of the element to listen for changes to.
4345
- */
4346
- id: string;
4347
- };
4348
- /**
4349
- * The handler that is called when the element changes.
4350
- */
4351
- handler: (
4352
- /**
4353
- * An object describing the change that occurred.
4354
- */
4355
- change: ElementChangeCallbackParams) => void;
4356
- }): VoidFunction;
4357
- /**
4358
- * Adds a listener for when an element is deleted.
4359
- *
4360
- * @returns A function to unsubscribe from the listener
4361
- *
4362
- * @event
4363
- * @example
4364
- * ```typescript
4365
- * const unsubscribe = felt.onElementDelete({
4366
- * options: { id: "element-1" },
4367
- * handler: () => console.log("element-1 deleted"),
4368
- * });
4369
- *
4370
- * // later on...
4371
- * unsubscribe();
4372
- * ```
4373
- */
4374
- onElementDelete(args: {
4375
- options: {
4376
- /**
4377
- * The id of the element to listen for deletions of.
4378
- */
4379
- id: string;
4380
- };
4381
- /**
4382
- * The handler that is called when the element is deleted.
4383
- */
4384
- handler: () => void;
4385
- }): VoidFunction;
4386
- /**
4387
- * Adds a listener for when an element group changes.
4388
- *
4389
- * @returns A function to unsubscribe from the listener
4390
- *
4391
- * @event
4392
- * @example
4393
- * ```typescript
4394
- * const unsubscribe = felt.onElementGroupChange({
4395
- * options: { id: "element-group-1" },
4396
- * handler: elementGroup => console.log(elementGroup.id),
4397
- * });
4398
- *
4399
- * // later on...
4400
- * unsubscribe();
4401
- * ```
4402
- */
4403
- onElementGroupChange(args: {
4404
- options: {
4405
- id: string;
4406
- };
4407
- handler: (change: ElementGroupChangeCallbackParams) => void;
4408
- }): VoidFunction;
4409
- /**
4410
- * Create a new element on the map.
4411
- *
4412
- * @example
4413
- * ```typescript
4414
- * const element = await felt.createElement({ type: "Place", coordinates: [10, 10] });
4415
- * ```
4416
- */
4417
- createElement(element: ElementCreate): Promise<Element>;
4418
- /**
4419
- * Update an element on the map.
4420
- *
4421
- * @example
4422
- * ```typescript
4423
- * // Update a place element's coordinates
4424
- * await felt.updateElement({
4425
- * id: "element-1",
4426
- * coordinates: [10, 20]
4427
- * });
4428
- *
4429
- * // Update a polygon's style
4430
- * await felt.updateElement({
4431
- * id: "element-2",
4432
- * color: "#ABC123",
4433
- * fillOpacity: 0.5
4434
- * });
4435
- * ```
4436
- */
4437
- updateElement(element: ElementUpdate): Promise<Element>;
4438
- /**
4439
- * Delete an element from the map.
4440
- *
4441
- * @example
4442
- * ```typescript
4443
- * await felt.deleteElement("element-1");
4444
- * ```
4445
- */
4446
- deleteElement(id: string): Promise<void>;
4447
- }
4448
-
4449
4140
  /**
4450
4141
  * A LayerFeature is a single geographical item in a layer.
4451
4142
  *
@@ -5752,37 +5443,8 @@ interface LayerFilters {
5752
5443
  * @group Filters
5753
5444
  */
5754
5445
  type GeometryFilter = FeltBoundary | PolygonGeometry | MultiPolygonGeometry | LngLatTuple[];
5755
- /**
5756
- * All the different sources for boundaries for a layer, including their combined result.
5757
- *
5758
- * @group Filters
5759
- */
5760
- interface LayerBoundaries {
5761
- /**
5762
- * Boundaries set by drawing spatial filters on the map.
5763
- *
5764
- * When there are multiple spatial filters, they are combined into a multi-polygon.
5765
- */
5766
- spatialFilters: MultiPolygonGeometry | null;
5767
- /**
5768
- * Boundaries that are set ephemerally by viewers in their own session.
5769
- *
5770
- * These are the filters that are set when the {@link LayersController.setLayerBoundary}
5771
- * method is called. There is no way to set these in the Felt UI - they can only be
5772
- * set using the SDK.
5773
- */
5774
- ephemeral: GeometryFilter | null;
5775
- /**
5776
- * The combined result of all the boundaries set on the layer.
5777
- *
5778
- * Each different source of boundary is intersected to produce the combined result.
5779
- *
5780
- */
5781
- combined: MultiPolygonGeometry | null;
5782
- }
5783
5446
 
5784
5447
  declare const AggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
5785
- declare const PrecomputedAggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "count"]>;
5786
5448
  declare const AggregationConfigSchema: z.ZodObject<{
5787
5449
  /**
5788
5450
  * The operation to use on the values from the features in the layer
@@ -5832,12 +5494,6 @@ interface AggregationConfig extends zInfer<typeof AggregationConfigSchema> {
5832
5494
  * @group Stats
5833
5495
  */
5834
5496
  type AggregationMethod = z.infer<typeof AggregateMethodSchema>;
5835
- /**
5836
- * The method to use for the precomputed aggregation.
5837
- *
5838
- * @group Stats
5839
- */
5840
- type PrecomputedAggregationMethod = z.infer<typeof PrecomputedAggregateMethodSchema>;
5841
5497
  /**
5842
5498
  * Defines how to aggregate a value across features in a layer with multiple aggregations
5843
5499
  * returned at once.
@@ -6475,274 +6131,53 @@ interface GetLayerCalculationParams<T extends AggregationMethod | "count"> exten
6475
6131
  */
6476
6132
  aggregation: MultiAggregationConfig<T>;
6477
6133
  }
6478
- declare const GridTypeSchema: z.ZodEnum<["h3"]>;
6134
+
6479
6135
  /**
6480
- * The type of grid to use for precomputed aggregate values.
6136
+ * The Layers controller allows you to get information about the layers on the
6137
+ * map, and make changes to their visibility.
6481
6138
  *
6482
- * @group Stats
6139
+ * Layers can be organised into groups, and their groups can also have their
6140
+ * visibility toggled.
6141
+ *
6142
+ * @group Controller
6143
+ * @public
6483
6144
  */
6484
- type GridType = z.infer<typeof GridTypeSchema>;
6485
- declare const CountGridConfigSchema: z.ZodObject<{
6486
- type: z.ZodEnum<["h3"]>;
6145
+ interface LayersController {
6487
6146
  /**
6488
- * The resolution of the grid to use for the precomputed calculation.
6147
+ * Get a single layer from the map by its id.
6148
+ *
6149
+ * @example
6150
+ * ```typescript
6151
+ * const layer = await felt.getLayer("layer-1");
6152
+ * ```
6153
+ * @returns The requested layer.
6489
6154
  */
6490
- resolution: z.ZodNumber;
6491
- method: z.ZodEnum<["count"]>;
6492
- }, "strip", z.ZodTypeAny, {
6493
- type: "h3";
6494
- method: "count";
6495
- resolution: number;
6496
- }, {
6497
- type: "h3";
6498
- method: "count";
6499
- resolution: number;
6500
- }>;
6501
- /**
6502
- * The grid configuration for a count-based precomputed aggregate value. Compared to the
6503
- * {@link AggregatedGridConfig}, the `attribute` property is not required, because the count
6504
- * is the same regardless of the attribute.
6505
- *
6506
- * Used inside {@link GetLayerPrecomputedCalculationParams}.
6507
- *
6508
- * @group Stats
6509
- */
6510
- interface CountGridConfig extends zInfer<typeof CountGridConfigSchema> {
6155
+ getLayer(
6511
6156
  /**
6512
- * The type of grid to use for the precomputed calculation.
6157
+ * The id of the layer you want to get.
6513
6158
  */
6514
- type: GridType;
6159
+ id: string): Promise<Layer | null>;
6515
6160
  /**
6516
- * The method to use for the precomputed calculation, which in this case is always "count".
6161
+ * Gets layers from the map, according to the constraints supplied. If no
6162
+ * constraints are supplied, all layers will be returned.
6163
+ *
6164
+ * @remarks The layers in the map, ordered by the order specified in Felt. This is not
6165
+ * necessarily the order that they are drawn in, as Felt draws points above
6166
+ * lines and lines above polygons, for instance.
6167
+ *
6168
+ * @example
6169
+ * ```typescript
6170
+ * const layers = await felt.getLayers();
6171
+ * ```
6172
+ * @returns All layers on the map.
6517
6173
  */
6518
- method: Extract<PrecomputedAggregationMethod, "count">;
6519
- }
6520
- declare const AggregatedGridConfigSchema: z.ZodObject<{
6521
- type: z.ZodEnum<["h3"]>;
6174
+ getLayers(
6522
6175
  /**
6523
- * The resolution of the grid to use for the precomputed calculation.
6176
+ * The constraints to apply to the layers returned from the map.
6524
6177
  */
6525
- resolution: z.ZodNumber;
6526
- method: z.ZodEnum<["avg", "max", "min", "sum"]>;
6178
+ constraint?: GetLayersConstraint): Promise<Array<Layer | null>>;
6527
6179
  /**
6528
- * The attribute to use for the precomputed calculation.
6529
- *
6530
- * This must be a numeric attribute;
6531
- */
6532
- attribute: z.ZodString;
6533
- }, "strip", z.ZodTypeAny, {
6534
- type: "h3";
6535
- attribute: string;
6536
- method: "avg" | "max" | "min" | "sum";
6537
- resolution: number;
6538
- }, {
6539
- type: "h3";
6540
- attribute: string;
6541
- method: "avg" | "max" | "min" | "sum";
6542
- resolution: number;
6543
- }>;
6544
- /**
6545
- * The grid configuration for an aggregated precomputed aggregate value. This requires
6546
- * an `attribute` property, because the numeric aggregation requires it.
6547
- *
6548
- * If you just want to count the features in each grid cell, use the {@link CountGridConfig}
6549
- * instead, where you are not required to specify an `attribute`.
6550
- *
6551
- * Used inside {@link GetLayerPrecomputedCalculationParams}.
6552
- *
6553
- * @group Stats
6554
- */
6555
- interface AggregatedGridConfig extends zInfer<typeof AggregatedGridConfigSchema> {
6556
- /**
6557
- * The type of grid to use for the precomputed calculation.
6558
- */
6559
- type: GridType;
6560
- /**
6561
- * The method to use for the precomputed calculation.
6562
- */
6563
- method: Exclude<PrecomputedAggregationMethod, "count">;
6564
- }
6565
- /**
6566
- * Describes the type of grid to use for precomputed aggregate values.
6567
- *
6568
- * @group Stats
6569
- */
6570
- type GridConfig = CountGridConfig | AggregatedGridConfig;
6571
- declare const GetLayerPrecomputedCalculationParamsSchema: z.ZodObject<{
6572
- /**
6573
- * The ID of the layer to calculate an aggregate value for.
6574
- */
6575
- layerId: z.ZodString;
6576
- boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
6577
- type: z.ZodLiteral<"Polygon">;
6578
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
6579
- }, "strip", z.ZodTypeAny, {
6580
- type: "Polygon";
6581
- coordinates: [number, number][][];
6582
- }, {
6583
- type: "Polygon";
6584
- coordinates: [number, number][][];
6585
- }>, z.ZodObject<{
6586
- type: z.ZodLiteral<"MultiPolygon">;
6587
- coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
6588
- }, "strip", z.ZodTypeAny, {
6589
- type: "MultiPolygon";
6590
- coordinates: [number, number][][][];
6591
- }, {
6592
- type: "MultiPolygon";
6593
- coordinates: [number, number][][][];
6594
- }>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
6595
- filters: z.ZodOptional<z.ZodUnion<[z.ZodType<FilterTernary, z.ZodTypeDef, FilterTernary>, z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["in", "ni"]>, z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>, "many">, z.ZodNull]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>], null>]>, z.ZodNull, z.ZodBoolean]>>;
6596
- /**
6597
- * The type of grid to use for the precomputed calculation.
6598
- */
6599
- gridConfig: z.ZodUnion<[z.ZodObject<{
6600
- type: z.ZodEnum<["h3"]>;
6601
- /**
6602
- * The resolution of the grid to use for the precomputed calculation.
6603
- */
6604
- resolution: z.ZodNumber;
6605
- method: z.ZodEnum<["count"]>;
6606
- }, "strip", z.ZodTypeAny, {
6607
- type: "h3";
6608
- method: "count";
6609
- resolution: number;
6610
- }, {
6611
- type: "h3";
6612
- method: "count";
6613
- resolution: number;
6614
- }>, z.ZodObject<{
6615
- type: z.ZodEnum<["h3"]>;
6616
- /**
6617
- * The resolution of the grid to use for the precomputed calculation.
6618
- */
6619
- resolution: z.ZodNumber;
6620
- method: z.ZodEnum<["avg", "max", "min", "sum"]>;
6621
- /**
6622
- * The attribute to use for the precomputed calculation.
6623
- *
6624
- * This must be a numeric attribute;
6625
- */
6626
- attribute: z.ZodString;
6627
- }, "strip", z.ZodTypeAny, {
6628
- type: "h3";
6629
- attribute: string;
6630
- method: "avg" | "max" | "min" | "sum";
6631
- resolution: number;
6632
- }, {
6633
- type: "h3";
6634
- attribute: string;
6635
- method: "avg" | "max" | "min" | "sum";
6636
- resolution: number;
6637
- }>]>;
6638
- }, "strip", z.ZodTypeAny, {
6639
- layerId: string;
6640
- gridConfig: {
6641
- type: "h3";
6642
- method: "count";
6643
- resolution: number;
6644
- } | {
6645
- type: "h3";
6646
- attribute: string;
6647
- method: "avg" | "max" | "min" | "sum";
6648
- resolution: number;
6649
- };
6650
- boundary?: [number, number, number, number] | [number, number][] | {
6651
- type: "Polygon";
6652
- coordinates: [number, number][][];
6653
- } | {
6654
- type: "MultiPolygon";
6655
- coordinates: [number, number][][][];
6656
- } | undefined;
6657
- filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
6658
- }, {
6659
- layerId: string;
6660
- gridConfig: {
6661
- type: "h3";
6662
- method: "count";
6663
- resolution: number;
6664
- } | {
6665
- type: "h3";
6666
- attribute: string;
6667
- method: "avg" | "max" | "min" | "sum";
6668
- resolution: number;
6669
- };
6670
- boundary?: [number, number, number, number] | [number, number][] | {
6671
- type: "Polygon";
6672
- coordinates: [number, number][][];
6673
- } | {
6674
- type: "MultiPolygon";
6675
- coordinates: [number, number][][][];
6676
- } | undefined;
6677
- filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
6678
- }>;
6679
- /**
6680
- * The parameters for calculating a single aggregate value for a layer, passed to
6681
- * the {@link LayersController.getPrecomputedAggregates} method.
6682
- *
6683
- * @group Stats
6684
- */
6685
- interface GetLayerPrecomputedCalculationParams extends z.infer<typeof GetLayerPrecomputedCalculationParamsSchema> {
6686
- /**
6687
- * Attribute filters for the features to include when calculating the aggregate value.
6688
- */
6689
- filters?: Filters;
6690
- /**
6691
- * The spatial boundary for the features to include when calculating the aggregate value.
6692
- */
6693
- boundary?: GeometryFilter;
6694
- /**
6695
- * The grid configuration to use for the precomputed calculation.
6696
- */
6697
- gridConfig: GridConfig;
6698
- }
6699
-
6700
- /**
6701
- * The Layers controller allows you to get information about the layers on the
6702
- * map, and make changes to their visibility.
6703
- *
6704
- * Layers can be organised into groups, and their groups can also have their
6705
- * visibility toggled.
6706
- *
6707
- * @group Controller
6708
- * @public
6709
- */
6710
- interface LayersController {
6711
- /**
6712
- * Get a single layer from the map by its id.
6713
- *
6714
- * @example
6715
- * ```typescript
6716
- * const layer = await felt.getLayer("layer-1");
6717
- * ```
6718
- * @returns The requested layer.
6719
- */
6720
- getLayer(
6721
- /**
6722
- * The id of the layer you want to get.
6723
- */
6724
- id: string): Promise<Layer | null>;
6725
- /**
6726
- * Gets layers from the map, according to the constraints supplied. If no
6727
- * constraints are supplied, all layers will be returned.
6728
- *
6729
- * @remarks The layers in the map, ordered by the order specified in Felt. This is not
6730
- * necessarily the order that they are drawn in, as Felt draws points above
6731
- * lines and lines above polygons, for instance.
6732
- *
6733
- * @example
6734
- * ```typescript
6735
- * const layers = await felt.getLayers();
6736
- * ```
6737
- * @returns All layers on the map.
6738
- */
6739
- getLayers(
6740
- /**
6741
- * The constraints to apply to the layers returned from the map.
6742
- */
6743
- constraint?: GetLayersConstraint): Promise<Array<Layer | null>>;
6744
- /**
6745
- * Hide or show layers with the given ids.
6180
+ * Hide or show layers with the given ids.
6746
6181
  *
6747
6182
  * @example
6748
6183
  * ```typescript
@@ -7096,90 +6531,6 @@ interface LayersController {
7096
6531
  };
7097
6532
  handler: (change: LayerFilters) => void;
7098
6533
  }): VoidFunction;
7099
- /**
7100
- * Get the spatial boundaries that are filtering a layer.
7101
- *
7102
- * @remarks
7103
- * The return type gives you the boundaries split up into the various sources
7104
- * that make up the overall boundary for a layer.
7105
- *
7106
- * The combined boundary is the intersection of the other sources of boundaries.
7107
- *
7108
- * @example
7109
- * ```typescript
7110
- * const boundaries = await felt.getLayerBoundaries("layer-1");
7111
- *
7112
- * console.log(boundaries?.combined);
7113
- * console.log(boundaries?.spatialFilters);
7114
- * console.log(boundaries?.ephemeral);
7115
- * ```
7116
- */
7117
- getLayerBoundaries(layerId: string): Promise<LayerBoundaries | null>;
7118
- /**
7119
- * Set the {@link LayerBoundaries.ephemeral | `ephemeral`} boundary for one or more layers.
7120
- *
7121
- * @example
7122
- * ```typescript
7123
- * await felt.setLayerBoundary({
7124
- * layerIds: ["layer-1", "layer-2"],
7125
- * boundary: { type: "MultiPolygon", coordinates: [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]] }
7126
- * });
7127
- * ```
7128
- */
7129
- setLayerBoundary(params: {
7130
- /**
7131
- * The ids of the layers to set the boundary for.
7132
- */
7133
- layerIds: Array<string>;
7134
- /**
7135
- * The boundary to set for the layer.
7136
- *
7137
- * Passing `null` clears the ephemeral boundary for the layer.
7138
- */
7139
- boundary: GeometryFilter | null;
7140
- }): Promise<void>;
7141
- /**
7142
- * Adds a listener for when a layer's spatial boundaries change.
7143
- *
7144
- * @returns A function to unsubscribe from the listener
7145
- *
7146
- * @remarks
7147
- * This event fires whenever any type of spatial boundary changes on the layer, including
7148
- * ephemeral boundaries set via the SDK or boundaries set through the Felt UI via
7149
- * Spatial filter components.
7150
- *
7151
- * @event
7152
- * @example
7153
- * ```typescript
7154
- * const unsubscribe = felt.onLayerBoundariesChange({
7155
- * options: { layerId: "layer-1" },
7156
- * handler: ({combined, ephemeral, spatialFilters}) => {
7157
- * console.log("Layer boundaries updated:", {
7158
- * combined, // All boundaries combined
7159
- * ephemeral, // Boundaries set via SDK
7160
- * spatialFilters // Boundaries set via UI
7161
- * });
7162
- * },
7163
- * });
7164
- *
7165
- * // later on...
7166
- * unsubscribe();
7167
- * ```
7168
- */
7169
- onLayerBoundariesChange(params: {
7170
- options: {
7171
- /**
7172
- * The id of the layer to listen for boundary changes on.
7173
- */
7174
- layerId: string;
7175
- };
7176
- /**
7177
- * A function that is called when the boundaries change.
7178
- *
7179
- * @param boundaries - The new boundaries for the layer.
7180
- */
7181
- handler: (boundaries: LayerBoundaries | null) => void;
7182
- }): VoidFunction;
7183
6534
  /**
7184
6535
  * Get the features that are currently **rendered** on the map in the viewport.
7185
6536
  *
@@ -7464,33 +6815,6 @@ interface LayersController {
7464
6815
  * ```
7465
6816
  */
7466
6817
  getAggregates<T extends AggregationMethod | "count">(params: GetLayerCalculationParams<T>): Promise<Record<T, number | null>>;
7467
- /**
7468
- * Calculates aggregates for spatial cells of a layer.
7469
- *
7470
- * @remarks
7471
- * Performs statistical calculations on spatial cells of a layer, returning min, max, avg, sum, and count. You can focus your calculation on specific areas or subsets
7472
- * of your data using boundaries and filters. When using the count method, an attribute is not required.
7473
- *
7474
- * @example
7475
- * ```typescript
7476
- * const aggregates = await felt.getPrecomputedAggregates({
7477
- * layerId: "buildings",
7478
- * gridConfig: {
7479
- * type: "h3",
7480
- * resolution: 10,
7481
- * method: "avg",
7482
- * attribute: "assessed_value"
7483
- * },
7484
- * });
7485
- * ```
7486
- */
7487
- getPrecomputedAggregates(params: GetLayerPrecomputedCalculationParams): Promise<{
7488
- avg: number | null;
7489
- max: number | null;
7490
- min: number | null;
7491
- sum: number | null;
7492
- count: number | null;
7493
- }>;
7494
6818
  /**
7495
6819
  * Get the schema for a layer.
7496
6820
  *
@@ -7535,64 +6859,6 @@ interface MapInteractionEvent {
7535
6859
  rasterValues: Array<RasterValue>;
7536
6860
  }
7537
6861
 
7538
- /**
7539
- * The Interactions controller allows you to observe interactions with the map
7540
- *
7541
- * @group Controller
7542
- * @public
7543
- */
7544
- interface InteractionsController {
7545
- /**
7546
- * Allows you to be notified the user clicks on the map.
7547
- *
7548
- * @returns A function to unsubscribe from the listener
7549
- *
7550
- * @event
7551
- * @example
7552
- * ```typescript
7553
- * const unsubscribe = felt.onPointerClick({
7554
- * handler: (event) => console.log(event.center, event.features),
7555
- * });
7556
- *
7557
- * // later on...
7558
- * unsubscribe();
7559
- * ```
7560
- */
7561
- onPointerClick(params: {
7562
- handler: (event: MapInteractionEvent) => void;
7563
- }): VoidFunction;
7564
- /**
7565
- * Allows you to be notified the user moves the mouse over the map.
7566
- *
7567
- * @returns A function to unsubscribe from the listener
7568
- *
7569
- * @event
7570
- * @example
7571
- * ```typescript
7572
- * // Track mouse movement and features under cursor
7573
- * const unsubscribe = felt.onPointerMove({
7574
- * handler: (event) => {
7575
- * console.log("Mouse position:", event.center);
7576
- * console.log("Features under cursor:", event.features);
7577
- * }
7578
- * });
7579
- *
7580
- * // later on...
7581
- * unsubscribe();
7582
- * ```
7583
- */
7584
- onPointerMove(
7585
- /**
7586
- * Params for the listener
7587
- */
7588
- params: {
7589
- /**
7590
- * The handler function
7591
- */
7592
- handler: (event: MapInteractionEvent) => void;
7593
- }): VoidFunction;
7594
- }
7595
-
7596
6862
  /**
7597
6863
  * The details of a map.
7598
6864
  *
@@ -7613,27 +6879,6 @@ type MapDetails = {
7613
6879
  description: string | null;
7614
6880
  };
7615
6881
 
7616
- /**
7617
- * @group Controller
7618
- * @public
7619
- */
7620
- interface MiscController {
7621
- /**
7622
- * Gets the details of the map.
7623
- *
7624
- * @example
7625
- * ```typescript
7626
- * const details = await felt.getMapDetails();
7627
- * console.log({
7628
- * id: details.id,
7629
- * title: details.title,
7630
- * description: details.description,
7631
- * });
7632
- * ```
7633
- */
7634
- getMapDetails(): Promise<MapDetails>;
7635
- }
7636
-
7637
6882
  /**
7638
6883
  * A reference to any kind of entity in the map.
7639
6884
  *
@@ -7751,109 +6996,9 @@ declare const FeatureSelectionSchema: z.ZodObject<{
7751
6996
  } | undefined;
7752
6997
  }>;
7753
6998
 
7754
- /**
7755
- * The Selection controller allows you to listen for changes to the selection on the map.
7756
- *
7757
- * @group Controller
7758
- * @public
7759
- */
7760
- interface SelectionController {
7761
- /**
7762
- * Gets the current selection as a list of entity identifiers.
7763
- *
7764
- * @example
7765
- * ```typescript
7766
- * const selection = await felt.getSelection();
7767
- * ```
7768
- */
7769
- getSelection(): Promise<EntityNode[]>;
7770
- /**
7771
- * Adds a listener for when the selection changes.
7772
- *
7773
- * @returns A function to unsubscribe from the listener
7774
- *
7775
- * @event
7776
- * @example
7777
- * ```typescript
7778
- * const unsubscribe = felt.onSelectionChange({
7779
- * handler: ({selection}) => console.log(selection),
7780
- * });
7781
- *
7782
- * // later on...
7783
- * unsubscribe();
7784
- * ```
7785
- */
7786
- onSelectionChange(params: {
7787
- handler: (change: {
7788
- /**
7789
- * The new selection. In the case where there are multiple entities selected,
7790
- * the array describes the chronological and semeantic order of the selection.
7791
- *
7792
- * Entities of the same type that are selected later will appear later in the
7793
- * list, but there are cases where multiple entity types can be selected at once,
7794
- * such as elements and features. In this case, the order of the _types_ of entities
7795
- * tells you which are considered more semantically important.
7796
- *
7797
- * For example, if a feature and element are selected, the feature will be at the
7798
- * tail of the list because pressing Escape will deselect the feature first, then
7799
- * pressing Escape again will deselect the element.
7800
- */
7801
- selection: EntityNode[];
7802
- }) => void;
7803
- }): VoidFunction;
7804
- /**
7805
- * Selects a feature on a layer. This will show the feature's popup, modal or
7806
- * sidebar (if configured) and highlight the feature.
7807
- *
7808
- * @example
7809
- * ```typescript
7810
- * felt.selectFeature({
7811
- * id: 123,
7812
- * layerId: "my-layer",
7813
- * showPopup: true,
7814
- * fitViewport: { maxZoom: 15 },
7815
- * });
7816
- * ```
7817
- */
7818
- selectFeature(params: FeatureSelection): Promise<void>;
7819
- /**
7820
- * Clears the current selection. This clears the selection of
7821
- *
7822
- * @example
7823
- * ```typescript
7824
- *
7825
- * // Removes all features and elements from the selection
7826
- * felt.clearSelection();
7827
- *
7828
- * // Removes only features from the selection
7829
- * felt.clearSelection({ features: true });
7830
- *
7831
- * // Removes only elements from the selection
7832
- * felt.clearSelection({ elements: true });
7833
- * ```
7834
- *
7835
- * @default
7836
- * ```typescript
7837
- * { features: true, elements: true }
7838
- * ```
7839
- *
7840
- * @param params - The parameters to clear the selection. If this is not provided,
7841
- * both features and elements will be cleared.
7842
- */
7843
- clearSelection(params?: {
7844
- /**
7845
- * Whether to clear the features from the selection.
7846
- */
7847
- features?: boolean;
7848
- /**
7849
- * Whether to clear the elements from the selection.
7850
- */
7851
- elements?: boolean;
7852
- }): Promise<void>;
7853
- }
7854
-
7855
- type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
7856
- type ConfigurableToolType = Exclude<ToolType, "link">;
6999
+ declare const ToolSchema: z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note", "link"]>;
7000
+ type ToolType = z.infer<typeof ToolSchema>;
7001
+ type ConfigurableToolType = keyof ToolSettingsMap;
7857
7002
  declare const PinToolSettingsSchema: z.ZodObject<{
7858
7003
  symbol: z.ZodString;
7859
7004
  color: z.ZodString;
@@ -8100,335 +7245,6 @@ type ToolSettingsMap = {
8100
7245
  type PlaceFrame = "frame-circle" | "frame-square" | null;
8101
7246
  type PlaceSymbol = "dot" | "square" | "diamond" | "triangle" | "x" | "plus" | "circle-line" | "circle-slash" | "star" | "heart" | "hexagon" | "octagon" | "pedestrian" | "bicycle" | "wheelchair" | "airport" | "car" | "bus" | "train" | "truck" | "ferry" | "sailboat" | "electric-service" | "gas-service" | "blood-clinic" | "badge" | "traffic-light" | "traffic-cone" | "road-sign-caution" | "person" | "restroom" | "house" | "work" | "letter" | "hotel" | "factory" | "hospital" | "religious-facility" | "school" | "government" | "university" | "bank" | "landmark" | "museum" | "clothing" | "shopping" | "store" | "bar" | "pub" | "cafe" | "food" | "park" | "amusement-park" | "camping-tent" | "cabin" | "picnic" | "water-refill" | "trailhead" | "guidepost" | "viewpoint" | "camera" | "us-football" | "football" | "tennis" | "binoculars" | "swimming" | "zap" | "battery-full" | "battery-half" | "battery-low" | "boom" | "radar" | "wind-turbine" | "solar-panel" | "antenna" | "telephone-pole" | "oil-well" | "oil-barrel" | "railroad-track" | "bridge" | "lighthouse" | "lock-closed" | "lock-open" | "wifi" | "trash" | "recycle" | "tree" | "flower" | "leaf" | "fire" | "mountain" | "snowy-mountain" | "volcano" | "island" | "wave" | "hot-springs" | "water" | "lake" | "ocean" | "animal" | "bird" | "duck" | "dog" | "fish" | "beach" | "wetland" | "sun" | "moon" | "cloud" | "partial-sun" | "rain" | "lightning" | "snowflake" | "wind" | "snow" | "fog" | "sleet" | "hurricane" | "warning" | "parking" | "info" | "circle-exclamation" | "circle-triangle" | "circle-x" | "circle-plus" | (`:${string}:` & {});
8102
7247
 
8103
- /**
8104
- * The Tools controller allows you to let users draw elements on the map.
8105
- *
8106
- * @group Controller
8107
- * @public
8108
- */
8109
- interface ToolsController {
8110
- /**
8111
- * Sets the tool to use for drawing elements on the map.
8112
- *
8113
- * @param tool - The tool to set.
8114
- *
8115
- * @example
8116
- * ```typescript
8117
- * // Set the tool to "marker"
8118
- * await felt.setTool("marker");
8119
- *
8120
- * // put down the tool
8121
- * await felt.setTool(null);
8122
- * ```
8123
- */
8124
- setTool(tool: ToolType | null): void;
8125
- /**
8126
- * Gets the current tool, if any is in use.
8127
- *
8128
- * @returns The current tool, or `null` if no tool is in use.
8129
- *
8130
- * @example
8131
- * ```typescript
8132
- * const tool = await felt.getTool(); // "marker", "polygon", etc.
8133
- * ```
8134
- */
8135
- getTool(): Promise<ToolType | null>;
8136
- /**
8137
- * Listens for changes to the current tool.
8138
- *
8139
- * @returns A function to unsubscribe from the listener
8140
- *
8141
- * @example
8142
- * ```typescript
8143
- * const unsubscribe = felt.onToolChange({
8144
- * handler: tool => console.log(tool),
8145
- * });
8146
- *
8147
- * // later on...
8148
- * unsubscribe();
8149
- * ```
8150
- */
8151
- onToolChange(args: {
8152
- /**
8153
- * This callback is called with the current tool whenever the tool changes.
8154
- *
8155
- * @param tool - The current tool, or `null` if no tool is in use.
8156
- */
8157
- handler: (tool: ToolType | null) => void;
8158
- }): VoidFunction;
8159
- /**
8160
- * Sets the settings for the current tool.
8161
- *
8162
- * @example
8163
- * ```typescript
8164
- * // Set the settings for the marker tool
8165
- * await felt.setToolSettings({
8166
- * tool: "marker",
8167
- * color: "#FE17",
8168
- * });
8169
- * ```
8170
- *
8171
- * @param settings - The settings to set.
8172
- */
8173
- setToolSettings(settings: InputToolSettings): void;
8174
- /**
8175
- * Gets the settings for the chosen tool
8176
- *
8177
- * @example
8178
- * ```typescript
8179
- * const settings = await felt.getToolSettings("marker");
8180
- * ```
8181
- *
8182
- * @returns The settings for the chosen tool.
8183
- */
8184
- getToolSettings<T extends ConfigurableToolType>(tool: T): Promise<ToolSettingsMap[T]>;
8185
- /**
8186
- * Listens for changes to the settings on all tools.
8187
- *
8188
- * @example
8189
- * ```typescript
8190
- * const unsubscribe = felt.onToolSettingsChange({
8191
- * handler: settings => console.log(settings),
8192
- * });
8193
- *
8194
- * // later on...
8195
- * unsubscribe();
8196
- * ```
8197
- * @returns A function to unsubscribe from the listener
8198
- */
8199
- onToolSettingsChange(args: {
8200
- handler: (settings: ToolSettingsChangeEvent) => void;
8201
- }): VoidFunction;
8202
- }
8203
-
8204
- /**
8205
- * @public
8206
- */
8207
- interface UiControlsOptions extends zInfer<typeof UiControlsOptionsSchema> {
8208
- }
8209
- /**
8210
- * @internal
8211
- * @ignore
8212
- */
8213
- declare const UiControlsOptionsSchema: z.ZodObject<{
8214
- /**
8215
- * Whether or not the legend is shown.
8216
- *
8217
- * @defaultValue true
8218
- */
8219
- showLegend: z.ZodOptional<z.ZodBoolean>;
8220
- /**
8221
- * When co-operative gestures are enabled, the pan and zoom gestures are
8222
- * adjusted to work better when the map is embedded in another page.
8223
- *
8224
- * @remarks
8225
- * On mobile devices, enabling co-operative gestures will allow the user to
8226
- * pan past the embedded map with a single finger drag. To pan the map, they
8227
- * must use two fingers.
8228
- *
8229
- * On desktop devices, enabling co-operative gestures allows the user to
8230
- * scroll past the embedded map using their scroll wheel or trackpad. To
8231
- * zoom the map, they must hold the Ctrl (Windows) or Command key (Mac) while
8232
- * scrolling.
8233
- *
8234
- * @defaultValue true
8235
- */
8236
- cooperativeGestures: z.ZodOptional<z.ZodBoolean>;
8237
- /**
8238
- * Whether or not the full screen button is shown in an embedded map.
8239
- *
8240
- * @remarks
8241
- * When clicked, this will open the map in a new tab or window.
8242
- *
8243
- * @defaultValue true
8244
- */
8245
- fullScreenButton: z.ZodOptional<z.ZodBoolean>;
8246
- /**
8247
- * Whether or not the geolocation button is shown in an embedded map.
8248
- *
8249
- * @remarks
8250
- * The geolocation feature will plot your position on the map. If you
8251
- * click the button again, it will start tracking your position.
8252
- *
8253
- * @defaultValue false
8254
- */
8255
- geolocation: z.ZodOptional<z.ZodBoolean>;
8256
- /**
8257
- * Whether or not the zoom controls are shown in an embedded map.
8258
- *
8259
- * @remarks
8260
- * This does not affect whether or not the map can be zoomed, just
8261
- * the display of the zoom controls in the bottom right corner of the map.
8262
- *
8263
- * @defaultValue true
8264
- */
8265
- zoomControls: z.ZodOptional<z.ZodBoolean>;
8266
- /**
8267
- * Whether or not the scale bar is shown in an embedded map.
8268
- *
8269
- * @defaultValue true
8270
- */
8271
- scaleBar: z.ZodOptional<z.ZodBoolean>;
8272
- }, "strip", z.ZodTypeAny, {
8273
- showLegend?: boolean | undefined;
8274
- cooperativeGestures?: boolean | undefined;
8275
- fullScreenButton?: boolean | undefined;
8276
- geolocation?: boolean | undefined;
8277
- zoomControls?: boolean | undefined;
8278
- scaleBar?: boolean | undefined;
8279
- }, {
8280
- showLegend?: boolean | undefined;
8281
- cooperativeGestures?: boolean | undefined;
8282
- fullScreenButton?: boolean | undefined;
8283
- geolocation?: boolean | undefined;
8284
- zoomControls?: boolean | undefined;
8285
- scaleBar?: boolean | undefined;
8286
- }>;
8287
- /**
8288
- * The options for which parts of the Felt UI can be shown when interacting with
8289
- * features and elements on the map.
8290
- *
8291
- * Switching these off can be useful if you add your own click, selection or hover
8292
- * handlers for features and elements.
8293
- *
8294
- * @public
8295
- */
8296
- interface UiOnMapInteractionsOptions extends zInfer<typeof UiOnMapInteractionsOptionsSchema> {
8297
- }
8298
- /**
8299
- * @internal
8300
- * @ignore
8301
- */
8302
- declare const UiOnMapInteractionsOptionsSchema: z.ZodObject<{
8303
- /**
8304
- * Set this to `false` to prevent the panel that shows information about a selected
8305
- * feature from being shown.
8306
- */
8307
- featureSelectPanel: z.ZodOptional<z.ZodBoolean>;
8308
- /**
8309
- * Set this to `false` to prevent the panel that shows information about a hovered
8310
- * feature from being shown.
8311
- */
8312
- featureHoverPanel: z.ZodOptional<z.ZodBoolean>;
8313
- /**
8314
- * Set this to `false` to prevent the panel that shows information about a selected
8315
- * element from being shown.
8316
- */
8317
- elementSelectPanel: z.ZodOptional<z.ZodBoolean>;
8318
- /**
8319
- * Set this to `false` to prevent clicking on a map link element from opening that link
8320
- * in a new tab or window.
8321
- */
8322
- linkClickOpen: z.ZodOptional<z.ZodBoolean>;
8323
- /**
8324
- * Set this to `false` to prevent clicking on an image element from opening the image
8325
- * in a lightbox.
8326
- */
8327
- imageLightboxOpen: z.ZodOptional<z.ZodBoolean>;
8328
- }, "strip", z.ZodTypeAny, {
8329
- featureSelectPanel?: boolean | undefined;
8330
- featureHoverPanel?: boolean | undefined;
8331
- elementSelectPanel?: boolean | undefined;
8332
- linkClickOpen?: boolean | undefined;
8333
- imageLightboxOpen?: boolean | undefined;
8334
- }, {
8335
- featureSelectPanel?: boolean | undefined;
8336
- featureHoverPanel?: boolean | undefined;
8337
- elementSelectPanel?: boolean | undefined;
8338
- linkClickOpen?: boolean | undefined;
8339
- imageLightboxOpen?: boolean | undefined;
8340
- }>;
8341
-
8342
- /**
8343
- * The UI controller allows you to control various aspects of the Felt UI in your embedded map.
8344
- *
8345
- * This includes enabling/disabling UI controls, managing on-map interactions, and controlling
8346
- * the visibility of UI components like the data table.
8347
- *
8348
- * @group Controller
8349
- * @public
8350
- */
8351
- interface UiController {
8352
- /**
8353
- * Updates the UI controls on the embedded map.
8354
- *
8355
- * @example
8356
- * ```typescript
8357
- * // Show some UI controls
8358
- * await felt.updateUiControls({
8359
- * showLegend: true,
8360
- * fullScreenButton: true,
8361
- * });
8362
- *
8363
- * // Disable some UI options
8364
- * await felt.updateUiControls({
8365
- * cooperativeGestures: false,
8366
- * geolocation: false,
8367
- * });
8368
- * ```
8369
- *
8370
- * @param controls - The controls to update.
8371
- */
8372
- updateUiControls(controls: UiControlsOptions): void;
8373
- /**
8374
- * Control the on-map UI shown when interacting with features and elements.
8375
- *
8376
- * If you add your own click, selection or hover handlers you may want to disable
8377
- * various parts of the Felt UI. This method allows you to control the visibility of
8378
- * various parts of the UI that might otherwise be shown when people click or hover
8379
- * on things.
8380
- *
8381
- * This does not affect selection. That means that selectable features and elements
8382
- * will still be selected when clicked.
8383
- *
8384
- * @example
8385
- * ```typescript
8386
- * // Disable UI when hovering or selecting features
8387
- * await felt.setOnMapInteractionsUi({
8388
- * featureSelectPanel: false,
8389
- * featureHoverPanel: false,
8390
- * });
8391
- * ```
8392
- */
8393
- setOnMapInteractionsUi(options: UiOnMapInteractionsOptions): void;
8394
- /**
8395
- * Shows a data table view for the specified layer, optionally sorted by a given attribute.
8396
- *
8397
- * @example
8398
- * ```typescript
8399
- * // Show data table with default sorting
8400
- * await felt.showLayerDataTable({
8401
- * layerId: "layer-1",
8402
- * });
8403
- *
8404
- * // Show data table sorted by height in descending order
8405
- * await felt.showLayerDataTable({
8406
- * layerId: "layer-1",
8407
- * sorting: {
8408
- * attribute: "height",
8409
- * direction: "desc",
8410
- * },
8411
- * });
8412
- *
8413
- * // Show the data table pane with no table visible
8414
- * await felt.showLayerDataTable();
8415
- * ```
8416
- */
8417
- showLayerDataTable(params?: {
8418
- layerId: string;
8419
- sorting?: SortConfig;
8420
- }): Promise<void>;
8421
- /**
8422
- * Hides the data table.
8423
- *
8424
- * @example
8425
- * ```typescript
8426
- * await felt.hideLayerDataTable();
8427
- * ```
8428
- */
8429
- hideLayerDataTable(): Promise<void>;
8430
- }
8431
-
8432
7248
  /**
8433
7249
  * The input type for setting the viewport to a particular center and zoom.
8434
7250
  *
@@ -8576,195 +7392,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
8576
7392
  bounds: [number, number, number, number];
8577
7393
  }>;
8578
7394
 
8579
- /**
8580
- * The viewport controller allows you to control the viewport of the map.
8581
- *
8582
- * You can get the current viewport, move the viewport, and be notified when
8583
- * the viewport changes.
8584
- *
8585
- * @group Controller
8586
- * @public
8587
- */
8588
- interface ViewportController {
8589
- /**
8590
- * Gets the current state of the viewport.
8591
- *
8592
- * @example
8593
- * ```typescript
8594
- * // Get current viewport state
8595
- * const viewport = await felt.getViewport();
8596
- * console.log({
8597
- * center: viewport.center,
8598
- * zoom: viewport.zoom,
8599
- * });
8600
- * ```
8601
- */
8602
- getViewport(): Promise<ViewportState>;
8603
- /**
8604
- * Moves the map to the specified location.
8605
- *
8606
- * @example
8607
- * ```typescript
8608
- * felt.setViewport({
8609
- * center: { latitude: 0, longitude: 0 },
8610
- * zoom: 10,
8611
- * });
8612
- * ```
8613
- */
8614
- setViewport(viewport: SetViewportCenterZoomParams): void;
8615
- /**
8616
- * Gets the current state of the viewport constraints.
8617
- *
8618
- * @example
8619
- * ```typescript
8620
- * // Get current viewport constraints
8621
- * const constraints = await felt.getViewportConstraints();
8622
- * if (constraints) {
8623
- * console.log({
8624
- * bounds: constraints.bounds,
8625
- * minZoom: constraints.minZoom,
8626
- * maxZoom: constraints.maxZoom
8627
- * });
8628
- * } else {
8629
- * console.log("No viewport constraints set");
8630
- * }
8631
- * ```
8632
- */
8633
- getViewportConstraints(): Promise<ViewportConstraints | null>;
8634
- /**
8635
- * Constrains the map viewport so it stays inside certain bounds and/or certain zoom levels.
8636
- *
8637
- * @example
8638
- * ```typescript
8639
- * felt.setViewportConstraints({
8640
- * bounds: [-122.5372532, 37.6652478, -122.1927016, 37.881707],
8641
- * minZoom: 1,
8642
- * maxZoom: 23,
8643
- * });
8644
- * ```
8645
- *
8646
- * @example
8647
- * every constraint is optional
8648
- * ```typescript
8649
- * felt.setViewportConstraints({
8650
- * bounds: [-122.5372532, 37.6652478, -122.1927016, 37.881707],
8651
- * });
8652
- * ```
8653
- *
8654
- * @example
8655
- * if a constraint is null, it will be removed but keeping the others
8656
- * ```typescript
8657
- * felt.setViewportConstraints({ bounds: null });
8658
- * ```
8659
- *
8660
- * @example
8661
- * if method receives null, it will remove the constraints
8662
- * ```typescript
8663
- * felt.setViewportConstraints(null);
8664
- * ```
8665
- */
8666
- setViewportConstraints(constraints: Partial<ViewportConstraints> | null): void;
8667
- /**
8668
- * Fits the map to the specified bounds.
8669
- *
8670
- * @example
8671
- * ```typescript
8672
- * const west = -122.4194;
8673
- * const south = 37.7749;
8674
- * const east = -122.4194;
8675
- * const north = 37.7749;
8676
- * felt.fitViewportToBounds({ bounds: [west, south, east, north] });
8677
- * ```
8678
- */
8679
- fitViewportToBounds(bounds: ViewportFitBoundsParams): void;
8680
- /**
8681
- * Adds a listener for when the viewport changes.
8682
- *
8683
- * @returns A function to unsubscribe from the listener
8684
- *
8685
- * @event
8686
- * @example
8687
- * ```typescript
8688
- * const unsubscribe = felt.onViewportMove({
8689
- * handler: viewport => console.log(viewport.center.latitude),
8690
- * });
8691
- *
8692
- * // later on...
8693
- * unsubscribe();
8694
- * ```
8695
- */
8696
- onViewportMove(args: {
8697
- /**
8698
- * This callback is called with the current viewport state whenever
8699
- * the viewport changes.
8700
- *
8701
- * @param viewport - The current viewport state.
8702
- */
8703
- handler: (viewport: ViewportState) => void;
8704
- }): VoidFunction;
8705
- /**
8706
- * Adds a listener for when the viewport move ends, which is when the user
8707
- * stops dragging or zooming the map, animations have finished, or inertial
8708
- * dragging ends.
8709
- *
8710
- * @returns A function to unsubscribe from the listener
8711
- *
8712
- * @event
8713
- * @example
8714
- * ```typescript
8715
- * const unsubscribe = felt.onViewportMoveEnd({
8716
- * handler: viewport => console.log(viewport.center.latitude),
8717
- * });
8718
- *
8719
- * // later on...
8720
- * unsubscribe();
8721
- * ```
8722
- */
8723
- onViewportMoveEnd(args: {
8724
- handler: (viewport: ViewportState) => void;
8725
- }): VoidFunction;
8726
- /**
8727
- * Adds a listener for when the map is idle, which is defined as:
8728
- * - No transitions are in progress
8729
- * - The user is not interacting with the map, e.g. by panning or zooming
8730
- * - All tiles for the current viewport have been loaded
8731
- * - Any fade transitions (e.g. for labels) have completed
8732
- *
8733
- * @returns A function to unsubscribe from the listener
8734
- *
8735
- * @event
8736
- * @example
8737
- * ```typescript
8738
- * const unsubscribe = felt.onMapIdle({ handler: () => console.log("map is idle") });
8739
- *
8740
- * // later on...
8741
- * unsubscribe();
8742
- * ```
8743
- */
8744
- onMapIdle(args: {
8745
- handler: () => void;
8746
- }): VoidFunction;
8747
- }
8748
-
8749
- /**
8750
- * This is the main interface for interacting with a Felt map.
8751
- *
8752
- * This interface is composed of the various controllers, each having a
8753
- * different area of responsibility.
8754
- *
8755
- * All the methods are listed here, but each controller is documented on its
8756
- * own to make it easier to find related methods and events.
8757
- *
8758
- * @group Controller
8759
- * @public
8760
- */
8761
- interface FeltController extends ViewportController, UiController, LayersController, ElementsController, SelectionController, InteractionsController, ToolsController, InteractionsController, MiscController {
8762
- /**
8763
- * The iframe element containing the Felt map, if it is an embedded map.
8764
- *
8765
- * @readonly
8766
- */
8767
- iframe: HTMLIFrameElement | null;
8768
- }
8769
-
8770
- export type { LayerChangeCallbackParams as $, TextElementUpdate as A, ElementsController as B, CircleElementCreate as C, MapInteractionEvent as D, Element as E, FeltController as F, GetElementGroupsConstraint as G, HighlighterElementCreate as H, ImageElementCreate as I, InteractionsController as J, CreateLayersFromGeoJsonParams as K, LinkElementRead as L, MarkerElementCreate as M, NoteElementCreate as N, DataOnlyLayer as O, PathElementCreate as P, FeltTiledVectorSource as Q, GeoJsonDataVectorSource as R, GeoJsonFileVectorSource as S, TextElementCreate as T, UiControlsOptions as U, ViewportCenterZoom as V, GeoJsonUrlVectorSource as W, GetLayerGroupsConstraint as X, GetLayersConstraint as Y, GetRenderedFeaturesConstraint as Z, Layer as _, CircleElementRead as a, LngLatTuple as a$, LayerCommon as a0, LayerGroup as a1, LayerGroupChangeCallbackParams as a2, LayerProcessingStatus as a3, LegendItem as a4, LegendItemChangeCallbackParams as a5, LegendItemIdentifier as a6, LegendItemsConstraint as a7, RasterBand as a8, RasterLayer as a9, GetLayerCategoriesParams as aA, GetLayerHistogramBin as aB, GetLayerHistogramParams as aC, GetLayerPrecomputedCalculationParams as aD, GridConfig as aE, GridType as aF, MultiAggregationConfig as aG, PrecomputedAggregationMethod as aH, ValueConfiguration as aI, LayersController as aJ, MapDetails as aK, MiscController as aL, ElementGroupNode as aM, ElementNode as aN, EntityNode as aO, FeatureNode as aP, FeatureSelection as aQ, LayerGroupNode as aR, LayerNode as aS, SelectionController as aT, FeltBoundary as aU, FeltZoom as aV, GeoJsonFeature as aW, GeoJsonGeometry as aX, GeoJsonProperties as aY, LatLng as aZ, LineStringGeometry as a_, RasterLayerSource as aa, UpdateLayerParams as ab, VectorLayer as ac, LayerFeature as ad, RasterValue as ae, LayerSchema as af, LayerSchemaAttribute as ag, LayerSchemaBooleanAttribute as ah, LayerSchemaCommonAttribute as ai, LayerSchemaDateAttribute as aj, LayerSchemaDateTimeAttribute as ak, LayerSchemaNumericAttribute as al, LayerSchemaTextAttribute as am, FilterExpression as an, FilterLogicGate as ao, FilterTernary as ap, Filters as aq, GeometryFilter as ar, LayerBoundaries as as, LayerFilters as at, AggregatedGridConfig as au, AggregationConfig as av, AggregationMethod as aw, CountGridConfig as ax, GetLayerCalculationParams as ay, GetLayerCategoriesGroup as az, CircleElementUpdate as b, MultiLineStringGeometry as b0, MultiPointGeometry as b1, MultiPolygonGeometry as b2, PointGeometry as b3, PolygonGeometry as b4, SetVisibilityRequest as b5, SortConfig as b6, SortDirection as b7, CircleToolSettings as b8, ConfigurableToolType as b9, HighlighterToolSettings as ba, InputToolSettings as bb, LineToolSettings as bc, MarkerToolSettings as bd, NoteToolSettings as be, PinToolSettings as bf, PlaceFrame as bg, PlaceSymbol as bh, PolygonToolSettings as bi, RouteToolSettings as bj, TextToolSettings as bk, ToolSettingsChangeEvent as bl, ToolSettingsMap as bm, ToolType as bn, ToolsController as bo, UiOnMapInteractionsOptions as bp, UiController as bq, SetViewportCenterZoomParams as br, ViewportConstraints as bs, ViewportFitBoundsParams as bt, ViewportState as bu, ViewportController as bv, UnwrapPromise as bw, UnionToIntersection as bx, PromiseOrNot as by, ElementChangeCallbackParams as c, ElementCreate as d, ElementGroup as e, ElementGroupChangeCallbackParams as f, ElementUpdate as g, GetElementsConstraint as h, HighlighterElementRead as i, HighlighterElementUpdate as j, ImageElementRead as k, ImageElementUpdate as l, MarkerElementRead as m, MarkerElementUpdate as n, NoteElementRead as o, NoteElementUpdate as p, PathElementRead as q, PathElementUpdate as r, PlaceElementCreate as s, PlaceElementRead as t, PlaceElementUpdate as u, PolygonElementCreate as v, PolygonElementRead as w, PolygonElementUpdate as x, TextElementRead as y, zInfer as z };
7395
+ export type { TextElementRead as $, MarkerElementCreate as A, MarkerElementRead as B, ConfigurableToolType as C, MarkerElementUpdate as D, Element as E, FeatureSelection as F, GeoJsonGeometry as G, HighlighterElementCreate as H, InputToolSettings as I, NoteElementRead as J, NoteElementUpdate as K, LayersController as L, MapInteractionEvent as M, NoteElementCreate as N, PathElementRead as O, PathElementCreate as P, PathElementUpdate as Q, PlaceElementCreate as R, SetVisibilityRequest as S, ToolType as T, PlaceElementRead as U, ViewportState as V, PlaceElementUpdate as W, PolygonElementCreate as X, PolygonElementRead as Y, PolygonElementUpdate as Z, TextElementCreate as _, GetElementsConstraint as a, MultiPointGeometry as a$, TextElementUpdate as a0, CreateLayersFromGeoJsonParams as a1, DataOnlyLayer as a2, FeltTiledVectorSource as a3, GeoJsonDataVectorSource as a4, GeoJsonFileVectorSource as a5, GeoJsonUrlVectorSource as a6, GetLayerGroupsConstraint as a7, GetLayersConstraint as a8, GetRenderedFeaturesConstraint as a9, FilterLogicGate as aA, FilterTernary as aB, Filters as aC, GeometryFilter as aD, LayerFilters as aE, AggregationConfig as aF, AggregationMethod as aG, GetLayerCalculationParams as aH, GetLayerCategoriesGroup as aI, GetLayerCategoriesParams as aJ, GetLayerHistogramBin as aK, GetLayerHistogramParams as aL, MultiAggregationConfig as aM, ValueConfiguration as aN, ElementGroupNode as aO, ElementNode as aP, FeatureNode as aQ, LayerGroupNode as aR, LayerNode as aS, FeltBoundary as aT, FeltZoom as aU, GeoJsonFeature as aV, GeoJsonProperties as aW, LatLng as aX, LineStringGeometry as aY, LngLatTuple as aZ, MultiLineStringGeometry as a_, Layer as aa, LayerChangeCallbackParams as ab, LayerCommon as ac, LayerGroup as ad, LayerGroupChangeCallbackParams as ae, LayerProcessingStatus as af, LegendItem as ag, LegendItemChangeCallbackParams as ah, LegendItemIdentifier as ai, LegendItemsConstraint as aj, RasterBand as ak, RasterLayer as al, RasterLayerSource as am, UpdateLayerParams as an, VectorLayer as ao, LayerFeature as ap, RasterValue as aq, LayerSchema as ar, LayerSchemaAttribute as as, LayerSchemaBooleanAttribute as at, LayerSchemaCommonAttribute as au, LayerSchemaDateAttribute as av, LayerSchemaDateTimeAttribute as aw, LayerSchemaNumericAttribute as ax, LayerSchemaTextAttribute as ay, FilterExpression as az, ElementGroup as b, MultiPolygonGeometry as b0, PointGeometry as b1, PolygonGeometry as b2, SortDirection as b3, CircleToolSettings as b4, HighlighterToolSettings as b5, LineToolSettings as b6, MarkerToolSettings as b7, NoteToolSettings as b8, PinToolSettings as b9, PlaceFrame as ba, PlaceSymbol as bb, PolygonToolSettings as bc, RouteToolSettings as bd, TextToolSettings as be, UnwrapPromise as bf, UnionToIntersection as bg, PromiseOrNot as bh, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, MapDetails as h, EntityNode as i, ToolSettingsMap as j, ToolSettingsChangeEvent as k, SortConfig as l, SetViewportCenterZoomParams as m, ViewportConstraints as n, ViewportFitBoundsParams as o, ViewportCenterZoom as p, CircleElementCreate as q, CircleElementRead as r, CircleElementUpdate as s, HighlighterElementRead as t, HighlighterElementUpdate as u, ImageElementCreate as v, ImageElementRead as w, ImageElementUpdate as x, LinkElementRead as y, zInfer as z };