@feltmaps/js-sdk 1.7.0-next.0 → 1.7.0-next.10

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,210 +6131,51 @@ interface GetLayerCalculationParams<T extends AggregationMethod | "count"> exten
6475
6131
  */
6476
6132
  aggregation: MultiAggregationConfig<T>;
6477
6133
  }
6478
- declare const GridTypeSchema: z.ZodEnum<["h3"]>;
6479
- type GridType = z.infer<typeof GridTypeSchema>;
6480
- declare const GridConfigSchema: z.ZodObject<{
6481
- /**
6482
- * The type of grid to use for the precomputed calculation.
6483
- */
6484
- type: z.ZodEnum<["h3"]>;
6485
- /**
6486
- * The resolution of the grid to use for the precomputed calculation.
6487
- */
6488
- resolution: z.ZodNumber;
6134
+
6135
+ /**
6136
+ * The Layers controller allows you to get information about the layers on the
6137
+ * map, and make changes to their visibility.
6138
+ *
6139
+ * Layers can be organised into groups, and their groups can also have their
6140
+ * visibility toggled.
6141
+ *
6142
+ * @group Controller
6143
+ * @public
6144
+ */
6145
+ interface LayersController {
6489
6146
  /**
6490
- * The method 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.
6491
6154
  */
6492
- method: z.ZodEnum<["avg", "max", "min", "sum", "count"]>;
6155
+ getLayer(
6493
6156
  /**
6494
- * The attribute to use for the precomputed calculation. This can be omitted if the aggregation method is "count".
6495
- * Must be a numeric attribute otherwise.
6157
+ * The id of the layer you want to get.
6496
6158
  */
6497
- attribute: z.ZodOptional<z.ZodString>;
6498
- }, "strip", z.ZodTypeAny, {
6499
- type: "h3";
6500
- method: "avg" | "max" | "min" | "sum" | "count";
6501
- resolution: number;
6502
- attribute?: string | undefined;
6503
- }, {
6504
- type: "h3";
6505
- method: "avg" | "max" | "min" | "sum" | "count";
6506
- resolution: number;
6507
- attribute?: string | undefined;
6508
- }>;
6509
- interface GridConfig extends z.infer<typeof GridConfigSchema> {
6159
+ id: string): Promise<Layer | null>;
6510
6160
  /**
6511
- * The type of grid to use for the precomputed calculation.
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.
6512
6173
  */
6513
- type: GridType;
6174
+ getLayers(
6514
6175
  /**
6515
- * The resolution of the grid to use for the precomputed calculation.
6176
+ * The constraints to apply to the layers returned from the map.
6516
6177
  */
6517
- resolution: number;
6518
- /**
6519
- * The method to use for the precomputed calculation.
6520
- */
6521
- method: PrecomputedAggregationMethod;
6522
- /**
6523
- * The attribute to use for the precomputed calculation.
6524
- */
6525
- attribute: string | undefined;
6526
- }
6527
- declare const GetLayerPrecomputedCalculationParamsSchema: z.ZodObject<{
6528
- /**
6529
- * The ID of the layer to calculate an aggregate value for.
6530
- */
6531
- layerId: z.ZodString;
6532
- boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
6533
- type: z.ZodLiteral<"Polygon">;
6534
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
6535
- }, "strip", z.ZodTypeAny, {
6536
- type: "Polygon";
6537
- coordinates: [number, number][][];
6538
- }, {
6539
- type: "Polygon";
6540
- coordinates: [number, number][][];
6541
- }>, z.ZodObject<{
6542
- type: z.ZodLiteral<"MultiPolygon">;
6543
- coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
6544
- }, "strip", z.ZodTypeAny, {
6545
- type: "MultiPolygon";
6546
- coordinates: [number, number][][][];
6547
- }, {
6548
- type: "MultiPolygon";
6549
- coordinates: [number, number][][][];
6550
- }>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
6551
- 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]>>;
6552
- /**
6553
- * The type of grid to use for the precomputed calculation.
6554
- */
6555
- gridConfig: z.ZodObject<{
6556
- /**
6557
- * The type of grid to use for the precomputed calculation.
6558
- */
6559
- type: z.ZodEnum<["h3"]>;
6560
- /**
6561
- * The resolution of the grid to use for the precomputed calculation.
6562
- */
6563
- resolution: z.ZodNumber;
6564
- /**
6565
- * The method to use for the precomputed calculation.
6566
- */
6567
- method: z.ZodEnum<["avg", "max", "min", "sum", "count"]>;
6568
- /**
6569
- * The attribute to use for the precomputed calculation. This can be omitted if the aggregation method is "count".
6570
- * Must be a numeric attribute otherwise.
6571
- */
6572
- attribute: z.ZodOptional<z.ZodString>;
6573
- }, "strip", z.ZodTypeAny, {
6574
- type: "h3";
6575
- method: "avg" | "max" | "min" | "sum" | "count";
6576
- resolution: number;
6577
- attribute?: string | undefined;
6578
- }, {
6579
- type: "h3";
6580
- method: "avg" | "max" | "min" | "sum" | "count";
6581
- resolution: number;
6582
- attribute?: string | undefined;
6583
- }>;
6584
- }, "strip", z.ZodTypeAny, {
6585
- layerId: string;
6586
- gridConfig: {
6587
- type: "h3";
6588
- method: "avg" | "max" | "min" | "sum" | "count";
6589
- resolution: number;
6590
- attribute?: string | undefined;
6591
- };
6592
- boundary?: [number, number, number, number] | [number, number][] | {
6593
- type: "Polygon";
6594
- coordinates: [number, number][][];
6595
- } | {
6596
- type: "MultiPolygon";
6597
- coordinates: [number, number][][][];
6598
- } | undefined;
6599
- 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;
6600
- }, {
6601
- layerId: string;
6602
- gridConfig: {
6603
- type: "h3";
6604
- method: "avg" | "max" | "min" | "sum" | "count";
6605
- resolution: number;
6606
- attribute?: string | undefined;
6607
- };
6608
- boundary?: [number, number, number, number] | [number, number][] | {
6609
- type: "Polygon";
6610
- coordinates: [number, number][][];
6611
- } | {
6612
- type: "MultiPolygon";
6613
- coordinates: [number, number][][][];
6614
- } | undefined;
6615
- 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;
6616
- }>;
6617
- /**
6618
- * The parameters for calculating a single aggregate value for a layer, passed to
6619
- * the {@link LayersController.getPrecomputedAggregates} method.
6620
- *
6621
- * @group Stats
6622
- */
6623
- interface GetLayerPrecomputedCalculationParams extends z.infer<typeof GetLayerPrecomputedCalculationParamsSchema> {
6624
- /**
6625
- * Attribute filters for the features to include when calculating the aggregate value.
6626
- */
6627
- filters?: Filters;
6628
- /**
6629
- * The spatial boundary for the features to include when calculating the aggregate value.
6630
- */
6631
- boundary?: GeometryFilter;
6632
- /**
6633
- * The grid configuration to use for the precomputed calculation.
6634
- */
6635
- gridConfig: GridConfig;
6636
- }
6637
-
6638
- /**
6639
- * The Layers controller allows you to get information about the layers on the
6640
- * map, and make changes to their visibility.
6641
- *
6642
- * Layers can be organised into groups, and their groups can also have their
6643
- * visibility toggled.
6644
- *
6645
- * @group Controller
6646
- * @public
6647
- */
6648
- interface LayersController {
6649
- /**
6650
- * Get a single layer from the map by its id.
6651
- *
6652
- * @example
6653
- * ```typescript
6654
- * const layer = await felt.getLayer("layer-1");
6655
- * ```
6656
- * @returns The requested layer.
6657
- */
6658
- getLayer(
6659
- /**
6660
- * The id of the layer you want to get.
6661
- */
6662
- id: string): Promise<Layer | null>;
6663
- /**
6664
- * Gets layers from the map, according to the constraints supplied. If no
6665
- * constraints are supplied, all layers will be returned.
6666
- *
6667
- * @remarks The layers in the map, ordered by the order specified in Felt. This is not
6668
- * necessarily the order that they are drawn in, as Felt draws points above
6669
- * lines and lines above polygons, for instance.
6670
- *
6671
- * @example
6672
- * ```typescript
6673
- * const layers = await felt.getLayers();
6674
- * ```
6675
- * @returns All layers on the map.
6676
- */
6677
- getLayers(
6678
- /**
6679
- * The constraints to apply to the layers returned from the map.
6680
- */
6681
- constraint?: GetLayersConstraint): Promise<Array<Layer | null>>;
6178
+ constraint?: GetLayersConstraint): Promise<Array<Layer | null>>;
6682
6179
  /**
6683
6180
  * Hide or show layers with the given ids.
6684
6181
  *
@@ -7034,90 +6531,6 @@ interface LayersController {
7034
6531
  };
7035
6532
  handler: (change: LayerFilters) => void;
7036
6533
  }): VoidFunction;
7037
- /**
7038
- * Get the spatial boundaries that are filtering a layer.
7039
- *
7040
- * @remarks
7041
- * The return type gives you the boundaries split up into the various sources
7042
- * that make up the overall boundary for a layer.
7043
- *
7044
- * The combined boundary is the intersection of the other sources of boundaries.
7045
- *
7046
- * @example
7047
- * ```typescript
7048
- * const boundaries = await felt.getLayerBoundaries("layer-1");
7049
- *
7050
- * console.log(boundaries?.combined);
7051
- * console.log(boundaries?.spatialFilters);
7052
- * console.log(boundaries?.ephemeral);
7053
- * ```
7054
- */
7055
- getLayerBoundaries(layerId: string): Promise<LayerBoundaries | null>;
7056
- /**
7057
- * Set the {@link LayerBoundaries.ephemeral | `ephemeral`} boundary for one or more layers.
7058
- *
7059
- * @example
7060
- * ```typescript
7061
- * await felt.setLayerBoundary({
7062
- * layerIds: ["layer-1", "layer-2"],
7063
- * boundary: { type: "MultiPolygon", coordinates: [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]] }
7064
- * });
7065
- * ```
7066
- */
7067
- setLayerBoundary(params: {
7068
- /**
7069
- * The ids of the layers to set the boundary for.
7070
- */
7071
- layerIds: Array<string>;
7072
- /**
7073
- * The boundary to set for the layer.
7074
- *
7075
- * Passing `null` clears the ephemeral boundary for the layer.
7076
- */
7077
- boundary: GeometryFilter | null;
7078
- }): Promise<void>;
7079
- /**
7080
- * Adds a listener for when a layer's spatial boundaries change.
7081
- *
7082
- * @returns A function to unsubscribe from the listener
7083
- *
7084
- * @remarks
7085
- * This event fires whenever any type of spatial boundary changes on the layer, including
7086
- * ephemeral boundaries set via the SDK or boundaries set through the Felt UI via
7087
- * Spatial filter components.
7088
- *
7089
- * @event
7090
- * @example
7091
- * ```typescript
7092
- * const unsubscribe = felt.onLayerBoundariesChange({
7093
- * options: { layerId: "layer-1" },
7094
- * handler: ({combined, ephemeral, spatialFilters}) => {
7095
- * console.log("Layer boundaries updated:", {
7096
- * combined, // All boundaries combined
7097
- * ephemeral, // Boundaries set via SDK
7098
- * spatialFilters // Boundaries set via UI
7099
- * });
7100
- * },
7101
- * });
7102
- *
7103
- * // later on...
7104
- * unsubscribe();
7105
- * ```
7106
- */
7107
- onLayerBoundariesChange(params: {
7108
- options: {
7109
- /**
7110
- * The id of the layer to listen for boundary changes on.
7111
- */
7112
- layerId: string;
7113
- };
7114
- /**
7115
- * A function that is called when the boundaries change.
7116
- *
7117
- * @param boundaries - The new boundaries for the layer.
7118
- */
7119
- handler: (boundaries: LayerBoundaries | null) => void;
7120
- }): VoidFunction;
7121
6534
  /**
7122
6535
  * Get the features that are currently **rendered** on the map in the viewport.
7123
6536
  *
@@ -7402,33 +6815,6 @@ interface LayersController {
7402
6815
  * ```
7403
6816
  */
7404
6817
  getAggregates<T extends AggregationMethod | "count">(params: GetLayerCalculationParams<T>): Promise<Record<T, number | null>>;
7405
- /**
7406
- * Calculates aggregates for spatial cells of a layer.
7407
- *
7408
- * @remarks
7409
- * 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
7410
- * of your data using boundaries and filters. When using the count method, an attribute is not required.
7411
- *
7412
- * @example
7413
- * ```typescript
7414
- * const aggregates = await felt.getPrecomputedAggregates({
7415
- * layerId: "buildings",
7416
- * gridConfig: {
7417
- * type: "h3",
7418
- * resolution: 10,
7419
- * method: "avg",
7420
- * attribute: "assessed_value"
7421
- * },
7422
- * });
7423
- * ```
7424
- */
7425
- getPrecomputedAggregates(params: GetLayerPrecomputedCalculationParams): Promise<{
7426
- avg: number | null;
7427
- max: number | null;
7428
- min: number | null;
7429
- sum: number | null;
7430
- count: number | null;
7431
- }>;
7432
6818
  /**
7433
6819
  * Get the schema for a layer.
7434
6820
  *
@@ -7473,64 +6859,6 @@ interface MapInteractionEvent {
7473
6859
  rasterValues: Array<RasterValue>;
7474
6860
  }
7475
6861
 
7476
- /**
7477
- * The Interactions controller allows you to observe interactions with the map
7478
- *
7479
- * @group Controller
7480
- * @public
7481
- */
7482
- interface InteractionsController {
7483
- /**
7484
- * Allows you to be notified the user clicks on the map.
7485
- *
7486
- * @returns A function to unsubscribe from the listener
7487
- *
7488
- * @event
7489
- * @example
7490
- * ```typescript
7491
- * const unsubscribe = felt.onPointerClick({
7492
- * handler: (event) => console.log(event.center, event.features),
7493
- * });
7494
- *
7495
- * // later on...
7496
- * unsubscribe();
7497
- * ```
7498
- */
7499
- onPointerClick(params: {
7500
- handler: (event: MapInteractionEvent) => void;
7501
- }): VoidFunction;
7502
- /**
7503
- * Allows you to be notified the user moves the mouse over the map.
7504
- *
7505
- * @returns A function to unsubscribe from the listener
7506
- *
7507
- * @event
7508
- * @example
7509
- * ```typescript
7510
- * // Track mouse movement and features under cursor
7511
- * const unsubscribe = felt.onPointerMove({
7512
- * handler: (event) => {
7513
- * console.log("Mouse position:", event.center);
7514
- * console.log("Features under cursor:", event.features);
7515
- * }
7516
- * });
7517
- *
7518
- * // later on...
7519
- * unsubscribe();
7520
- * ```
7521
- */
7522
- onPointerMove(
7523
- /**
7524
- * Params for the listener
7525
- */
7526
- params: {
7527
- /**
7528
- * The handler function
7529
- */
7530
- handler: (event: MapInteractionEvent) => void;
7531
- }): VoidFunction;
7532
- }
7533
-
7534
6862
  /**
7535
6863
  * The details of a map.
7536
6864
  *
@@ -7551,27 +6879,6 @@ type MapDetails = {
7551
6879
  description: string | null;
7552
6880
  };
7553
6881
 
7554
- /**
7555
- * @group Controller
7556
- * @public
7557
- */
7558
- interface MiscController {
7559
- /**
7560
- * Gets the details of the map.
7561
- *
7562
- * @example
7563
- * ```typescript
7564
- * const details = await felt.getMapDetails();
7565
- * console.log({
7566
- * id: details.id,
7567
- * title: details.title,
7568
- * description: details.description,
7569
- * });
7570
- * ```
7571
- */
7572
- getMapDetails(): Promise<MapDetails>;
7573
- }
7574
-
7575
6882
  /**
7576
6883
  * A reference to any kind of entity in the map.
7577
6884
  *
@@ -7689,109 +6996,9 @@ declare const FeatureSelectionSchema: z.ZodObject<{
7689
6996
  } | undefined;
7690
6997
  }>;
7691
6998
 
7692
- /**
7693
- * The Selection controller allows you to listen for changes to the selection on the map.
7694
- *
7695
- * @group Controller
7696
- * @public
7697
- */
7698
- interface SelectionController {
7699
- /**
7700
- * Gets the current selection as a list of entity identifiers.
7701
- *
7702
- * @example
7703
- * ```typescript
7704
- * const selection = await felt.getSelection();
7705
- * ```
7706
- */
7707
- getSelection(): Promise<EntityNode[]>;
7708
- /**
7709
- * Adds a listener for when the selection changes.
7710
- *
7711
- * @returns A function to unsubscribe from the listener
7712
- *
7713
- * @event
7714
- * @example
7715
- * ```typescript
7716
- * const unsubscribe = felt.onSelectionChange({
7717
- * handler: ({selection}) => console.log(selection),
7718
- * });
7719
- *
7720
- * // later on...
7721
- * unsubscribe();
7722
- * ```
7723
- */
7724
- onSelectionChange(params: {
7725
- handler: (change: {
7726
- /**
7727
- * The new selection. In the case where there are multiple entities selected,
7728
- * the array describes the chronological and semeantic order of the selection.
7729
- *
7730
- * Entities of the same type that are selected later will appear later in the
7731
- * list, but there are cases where multiple entity types can be selected at once,
7732
- * such as elements and features. In this case, the order of the _types_ of entities
7733
- * tells you which are considered more semantically important.
7734
- *
7735
- * For example, if a feature and element are selected, the feature will be at the
7736
- * tail of the list because pressing Escape will deselect the feature first, then
7737
- * pressing Escape again will deselect the element.
7738
- */
7739
- selection: EntityNode[];
7740
- }) => void;
7741
- }): VoidFunction;
7742
- /**
7743
- * Selects a feature on a layer. This will show the feature's popup, modal or
7744
- * sidebar (if configured) and highlight the feature.
7745
- *
7746
- * @example
7747
- * ```typescript
7748
- * felt.selectFeature({
7749
- * id: 123,
7750
- * layerId: "my-layer",
7751
- * showPopup: true,
7752
- * fitViewport: { maxZoom: 15 },
7753
- * });
7754
- * ```
7755
- */
7756
- selectFeature(params: FeatureSelection): Promise<void>;
7757
- /**
7758
- * Clears the current selection. This clears the selection of
7759
- *
7760
- * @example
7761
- * ```typescript
7762
- *
7763
- * // Removes all features and elements from the selection
7764
- * felt.clearSelection();
7765
- *
7766
- * // Removes only features from the selection
7767
- * felt.clearSelection({ features: true });
7768
- *
7769
- * // Removes only elements from the selection
7770
- * felt.clearSelection({ elements: true });
7771
- * ```
7772
- *
7773
- * @default
7774
- * ```typescript
7775
- * { features: true, elements: true }
7776
- * ```
7777
- *
7778
- * @param params - The parameters to clear the selection. If this is not provided,
7779
- * both features and elements will be cleared.
7780
- */
7781
- clearSelection(params?: {
7782
- /**
7783
- * Whether to clear the features from the selection.
7784
- */
7785
- features?: boolean;
7786
- /**
7787
- * Whether to clear the elements from the selection.
7788
- */
7789
- elements?: boolean;
7790
- }): Promise<void>;
7791
- }
7792
-
7793
- type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
7794
- 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;
7795
7002
  declare const PinToolSettingsSchema: z.ZodObject<{
7796
7003
  symbol: z.ZodString;
7797
7004
  color: z.ZodString;
@@ -8038,335 +7245,6 @@ type ToolSettingsMap = {
8038
7245
  type PlaceFrame = "frame-circle" | "frame-square" | null;
8039
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}:` & {});
8040
7247
 
8041
- /**
8042
- * The Tools controller allows you to let users draw elements on the map.
8043
- *
8044
- * @group Controller
8045
- * @public
8046
- */
8047
- interface ToolsController {
8048
- /**
8049
- * Sets the tool to use for drawing elements on the map.
8050
- *
8051
- * @param tool - The tool to set.
8052
- *
8053
- * @example
8054
- * ```typescript
8055
- * // Set the tool to "marker"
8056
- * await felt.setTool("marker");
8057
- *
8058
- * // put down the tool
8059
- * await felt.setTool(null);
8060
- * ```
8061
- */
8062
- setTool(tool: ToolType | null): void;
8063
- /**
8064
- * Gets the current tool, if any is in use.
8065
- *
8066
- * @returns The current tool, or `null` if no tool is in use.
8067
- *
8068
- * @example
8069
- * ```typescript
8070
- * const tool = await felt.getTool(); // "marker", "polygon", etc.
8071
- * ```
8072
- */
8073
- getTool(): Promise<ToolType | null>;
8074
- /**
8075
- * Listens for changes to the current tool.
8076
- *
8077
- * @returns A function to unsubscribe from the listener
8078
- *
8079
- * @example
8080
- * ```typescript
8081
- * const unsubscribe = felt.onToolChange({
8082
- * handler: tool => console.log(tool),
8083
- * });
8084
- *
8085
- * // later on...
8086
- * unsubscribe();
8087
- * ```
8088
- */
8089
- onToolChange(args: {
8090
- /**
8091
- * This callback is called with the current tool whenever the tool changes.
8092
- *
8093
- * @param tool - The current tool, or `null` if no tool is in use.
8094
- */
8095
- handler: (tool: ToolType | null) => void;
8096
- }): VoidFunction;
8097
- /**
8098
- * Sets the settings for the current tool.
8099
- *
8100
- * @example
8101
- * ```typescript
8102
- * // Set the settings for the marker tool
8103
- * await felt.setToolSettings({
8104
- * tool: "marker",
8105
- * color: "#FE17",
8106
- * });
8107
- * ```
8108
- *
8109
- * @param settings - The settings to set.
8110
- */
8111
- setToolSettings(settings: InputToolSettings): void;
8112
- /**
8113
- * Gets the settings for the chosen tool
8114
- *
8115
- * @example
8116
- * ```typescript
8117
- * const settings = await felt.getToolSettings("marker");
8118
- * ```
8119
- *
8120
- * @returns The settings for the chosen tool.
8121
- */
8122
- getToolSettings<T extends ConfigurableToolType>(tool: T): Promise<ToolSettingsMap[T]>;
8123
- /**
8124
- * Listens for changes to the settings on all tools.
8125
- *
8126
- * @example
8127
- * ```typescript
8128
- * const unsubscribe = felt.onToolSettingsChange({
8129
- * handler: settings => console.log(settings),
8130
- * });
8131
- *
8132
- * // later on...
8133
- * unsubscribe();
8134
- * ```
8135
- * @returns A function to unsubscribe from the listener
8136
- */
8137
- onToolSettingsChange(args: {
8138
- handler: (settings: ToolSettingsChangeEvent) => void;
8139
- }): VoidFunction;
8140
- }
8141
-
8142
- /**
8143
- * @public
8144
- */
8145
- interface UiControlsOptions extends zInfer<typeof UiControlsOptionsSchema> {
8146
- }
8147
- /**
8148
- * @internal
8149
- * @ignore
8150
- */
8151
- declare const UiControlsOptionsSchema: z.ZodObject<{
8152
- /**
8153
- * Whether or not the legend is shown.
8154
- *
8155
- * @defaultValue true
8156
- */
8157
- showLegend: z.ZodOptional<z.ZodBoolean>;
8158
- /**
8159
- * When co-operative gestures are enabled, the pan and zoom gestures are
8160
- * adjusted to work better when the map is embedded in another page.
8161
- *
8162
- * @remarks
8163
- * On mobile devices, enabling co-operative gestures will allow the user to
8164
- * pan past the embedded map with a single finger drag. To pan the map, they
8165
- * must use two fingers.
8166
- *
8167
- * On desktop devices, enabling co-operative gestures allows the user to
8168
- * scroll past the embedded map using their scroll wheel or trackpad. To
8169
- * zoom the map, they must hold the Ctrl (Windows) or Command key (Mac) while
8170
- * scrolling.
8171
- *
8172
- * @defaultValue true
8173
- */
8174
- cooperativeGestures: z.ZodOptional<z.ZodBoolean>;
8175
- /**
8176
- * Whether or not the full screen button is shown in an embedded map.
8177
- *
8178
- * @remarks
8179
- * When clicked, this will open the map in a new tab or window.
8180
- *
8181
- * @defaultValue true
8182
- */
8183
- fullScreenButton: z.ZodOptional<z.ZodBoolean>;
8184
- /**
8185
- * Whether or not the geolocation button is shown in an embedded map.
8186
- *
8187
- * @remarks
8188
- * The geolocation feature will plot your position on the map. If you
8189
- * click the button again, it will start tracking your position.
8190
- *
8191
- * @defaultValue false
8192
- */
8193
- geolocation: z.ZodOptional<z.ZodBoolean>;
8194
- /**
8195
- * Whether or not the zoom controls are shown in an embedded map.
8196
- *
8197
- * @remarks
8198
- * This does not affect whether or not the map can be zoomed, just
8199
- * the display of the zoom controls in the bottom right corner of the map.
8200
- *
8201
- * @defaultValue true
8202
- */
8203
- zoomControls: z.ZodOptional<z.ZodBoolean>;
8204
- /**
8205
- * Whether or not the scale bar is shown in an embedded map.
8206
- *
8207
- * @defaultValue true
8208
- */
8209
- scaleBar: z.ZodOptional<z.ZodBoolean>;
8210
- }, "strip", z.ZodTypeAny, {
8211
- showLegend?: boolean | undefined;
8212
- cooperativeGestures?: boolean | undefined;
8213
- fullScreenButton?: boolean | undefined;
8214
- geolocation?: boolean | undefined;
8215
- zoomControls?: boolean | undefined;
8216
- scaleBar?: boolean | undefined;
8217
- }, {
8218
- showLegend?: boolean | undefined;
8219
- cooperativeGestures?: boolean | undefined;
8220
- fullScreenButton?: boolean | undefined;
8221
- geolocation?: boolean | undefined;
8222
- zoomControls?: boolean | undefined;
8223
- scaleBar?: boolean | undefined;
8224
- }>;
8225
- /**
8226
- * The options for which parts of the Felt UI can be shown when interacting with
8227
- * features and elements on the map.
8228
- *
8229
- * Switching these off can be useful if you add your own click, selection or hover
8230
- * handlers for features and elements.
8231
- *
8232
- * @public
8233
- */
8234
- interface UiOnMapInteractionsOptions extends zInfer<typeof UiOnMapInteractionsOptionsSchema> {
8235
- }
8236
- /**
8237
- * @internal
8238
- * @ignore
8239
- */
8240
- declare const UiOnMapInteractionsOptionsSchema: z.ZodObject<{
8241
- /**
8242
- * Set this to `false` to prevent the panel that shows information about a selected
8243
- * feature from being shown.
8244
- */
8245
- featureSelectPanel: z.ZodOptional<z.ZodBoolean>;
8246
- /**
8247
- * Set this to `false` to prevent the panel that shows information about a hovered
8248
- * feature from being shown.
8249
- */
8250
- featureHoverPanel: z.ZodOptional<z.ZodBoolean>;
8251
- /**
8252
- * Set this to `false` to prevent the panel that shows information about a selected
8253
- * element from being shown.
8254
- */
8255
- elementSelectPanel: z.ZodOptional<z.ZodBoolean>;
8256
- /**
8257
- * Set this to `false` to prevent clicking on a map link element from opening that link
8258
- * in a new tab or window.
8259
- */
8260
- linkClickOpen: z.ZodOptional<z.ZodBoolean>;
8261
- /**
8262
- * Set this to `false` to prevent clicking on an image element from opening the image
8263
- * in a lightbox.
8264
- */
8265
- imageLightboxOpen: z.ZodOptional<z.ZodBoolean>;
8266
- }, "strip", z.ZodTypeAny, {
8267
- featureSelectPanel?: boolean | undefined;
8268
- featureHoverPanel?: boolean | undefined;
8269
- elementSelectPanel?: boolean | undefined;
8270
- linkClickOpen?: boolean | undefined;
8271
- imageLightboxOpen?: boolean | undefined;
8272
- }, {
8273
- featureSelectPanel?: boolean | undefined;
8274
- featureHoverPanel?: boolean | undefined;
8275
- elementSelectPanel?: boolean | undefined;
8276
- linkClickOpen?: boolean | undefined;
8277
- imageLightboxOpen?: boolean | undefined;
8278
- }>;
8279
-
8280
- /**
8281
- * The UI controller allows you to control various aspects of the Felt UI in your embedded map.
8282
- *
8283
- * This includes enabling/disabling UI controls, managing on-map interactions, and controlling
8284
- * the visibility of UI components like the data table.
8285
- *
8286
- * @group Controller
8287
- * @public
8288
- */
8289
- interface UiController {
8290
- /**
8291
- * Updates the UI controls on the embedded map.
8292
- *
8293
- * @example
8294
- * ```typescript
8295
- * // Show some UI controls
8296
- * await felt.updateUiControls({
8297
- * showLegend: true,
8298
- * fullScreenButton: true,
8299
- * });
8300
- *
8301
- * // Disable some UI options
8302
- * await felt.updateUiControls({
8303
- * cooperativeGestures: false,
8304
- * geolocation: false,
8305
- * });
8306
- * ```
8307
- *
8308
- * @param controls - The controls to update.
8309
- */
8310
- updateUiControls(controls: UiControlsOptions): void;
8311
- /**
8312
- * Control the on-map UI shown when interacting with features and elements.
8313
- *
8314
- * If you add your own click, selection or hover handlers you may want to disable
8315
- * various parts of the Felt UI. This method allows you to control the visibility of
8316
- * various parts of the UI that might otherwise be shown when people click or hover
8317
- * on things.
8318
- *
8319
- * This does not affect selection. That means that selectable features and elements
8320
- * will still be selected when clicked.
8321
- *
8322
- * @example
8323
- * ```typescript
8324
- * // Disable UI when hovering or selecting features
8325
- * await felt.setOnMapInteractionsUi({
8326
- * featureSelectPanel: false,
8327
- * featureHoverPanel: false,
8328
- * });
8329
- * ```
8330
- */
8331
- setOnMapInteractionsUi(options: UiOnMapInteractionsOptions): void;
8332
- /**
8333
- * Shows a data table view for the specified layer, optionally sorted by a given attribute.
8334
- *
8335
- * @example
8336
- * ```typescript
8337
- * // Show data table with default sorting
8338
- * await felt.showLayerDataTable({
8339
- * layerId: "layer-1",
8340
- * });
8341
- *
8342
- * // Show data table sorted by height in descending order
8343
- * await felt.showLayerDataTable({
8344
- * layerId: "layer-1",
8345
- * sorting: {
8346
- * attribute: "height",
8347
- * direction: "desc",
8348
- * },
8349
- * });
8350
- *
8351
- * // Show the data table pane with no table visible
8352
- * await felt.showLayerDataTable();
8353
- * ```
8354
- */
8355
- showLayerDataTable(params?: {
8356
- layerId: string;
8357
- sorting?: SortConfig;
8358
- }): Promise<void>;
8359
- /**
8360
- * Hides the data table.
8361
- *
8362
- * @example
8363
- * ```typescript
8364
- * await felt.hideLayerDataTable();
8365
- * ```
8366
- */
8367
- hideLayerDataTable(): Promise<void>;
8368
- }
8369
-
8370
7248
  /**
8371
7249
  * The input type for setting the viewport to a particular center and zoom.
8372
7250
  *
@@ -8514,195 +7392,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
8514
7392
  bounds: [number, number, number, number];
8515
7393
  }>;
8516
7394
 
8517
- /**
8518
- * The viewport controller allows you to control the viewport of the map.
8519
- *
8520
- * You can get the current viewport, move the viewport, and be notified when
8521
- * the viewport changes.
8522
- *
8523
- * @group Controller
8524
- * @public
8525
- */
8526
- interface ViewportController {
8527
- /**
8528
- * Gets the current state of the viewport.
8529
- *
8530
- * @example
8531
- * ```typescript
8532
- * // Get current viewport state
8533
- * const viewport = await felt.getViewport();
8534
- * console.log({
8535
- * center: viewport.center,
8536
- * zoom: viewport.zoom,
8537
- * });
8538
- * ```
8539
- */
8540
- getViewport(): Promise<ViewportState>;
8541
- /**
8542
- * Moves the map to the specified location.
8543
- *
8544
- * @example
8545
- * ```typescript
8546
- * felt.setViewport({
8547
- * center: { latitude: 0, longitude: 0 },
8548
- * zoom: 10,
8549
- * });
8550
- * ```
8551
- */
8552
- setViewport(viewport: SetViewportCenterZoomParams): void;
8553
- /**
8554
- * Gets the current state of the viewport constraints.
8555
- *
8556
- * @example
8557
- * ```typescript
8558
- * // Get current viewport constraints
8559
- * const constraints = await felt.getViewportConstraints();
8560
- * if (constraints) {
8561
- * console.log({
8562
- * bounds: constraints.bounds,
8563
- * minZoom: constraints.minZoom,
8564
- * maxZoom: constraints.maxZoom
8565
- * });
8566
- * } else {
8567
- * console.log("No viewport constraints set");
8568
- * }
8569
- * ```
8570
- */
8571
- getViewportConstraints(): Promise<ViewportConstraints | null>;
8572
- /**
8573
- * Constrains the map viewport so it stays inside certain bounds and/or certain zoom levels.
8574
- *
8575
- * @example
8576
- * ```typescript
8577
- * felt.setViewportConstraints({
8578
- * bounds: [-122.5372532, 37.6652478, -122.1927016, 37.881707],
8579
- * minZoom: 1,
8580
- * maxZoom: 23,
8581
- * });
8582
- * ```
8583
- *
8584
- * @example
8585
- * every constraint is optional
8586
- * ```typescript
8587
- * felt.setViewportConstraints({
8588
- * bounds: [-122.5372532, 37.6652478, -122.1927016, 37.881707],
8589
- * });
8590
- * ```
8591
- *
8592
- * @example
8593
- * if a constraint is null, it will be removed but keeping the others
8594
- * ```typescript
8595
- * felt.setViewportConstraints({ bounds: null });
8596
- * ```
8597
- *
8598
- * @example
8599
- * if method receives null, it will remove the constraints
8600
- * ```typescript
8601
- * felt.setViewportConstraints(null);
8602
- * ```
8603
- */
8604
- setViewportConstraints(constraints: Partial<ViewportConstraints> | null): void;
8605
- /**
8606
- * Fits the map to the specified bounds.
8607
- *
8608
- * @example
8609
- * ```typescript
8610
- * const west = -122.4194;
8611
- * const south = 37.7749;
8612
- * const east = -122.4194;
8613
- * const north = 37.7749;
8614
- * felt.fitViewportToBounds({ bounds: [west, south, east, north] });
8615
- * ```
8616
- */
8617
- fitViewportToBounds(bounds: ViewportFitBoundsParams): void;
8618
- /**
8619
- * Adds a listener for when the viewport changes.
8620
- *
8621
- * @returns A function to unsubscribe from the listener
8622
- *
8623
- * @event
8624
- * @example
8625
- * ```typescript
8626
- * const unsubscribe = felt.onViewportMove({
8627
- * handler: viewport => console.log(viewport.center.latitude),
8628
- * });
8629
- *
8630
- * // later on...
8631
- * unsubscribe();
8632
- * ```
8633
- */
8634
- onViewportMove(args: {
8635
- /**
8636
- * This callback is called with the current viewport state whenever
8637
- * the viewport changes.
8638
- *
8639
- * @param viewport - The current viewport state.
8640
- */
8641
- handler: (viewport: ViewportState) => void;
8642
- }): VoidFunction;
8643
- /**
8644
- * Adds a listener for when the viewport move ends, which is when the user
8645
- * stops dragging or zooming the map, animations have finished, or inertial
8646
- * dragging ends.
8647
- *
8648
- * @returns A function to unsubscribe from the listener
8649
- *
8650
- * @event
8651
- * @example
8652
- * ```typescript
8653
- * const unsubscribe = felt.onViewportMoveEnd({
8654
- * handler: viewport => console.log(viewport.center.latitude),
8655
- * });
8656
- *
8657
- * // later on...
8658
- * unsubscribe();
8659
- * ```
8660
- */
8661
- onViewportMoveEnd(args: {
8662
- handler: (viewport: ViewportState) => void;
8663
- }): VoidFunction;
8664
- /**
8665
- * Adds a listener for when the map is idle, which is defined as:
8666
- * - No transitions are in progress
8667
- * - The user is not interacting with the map, e.g. by panning or zooming
8668
- * - All tiles for the current viewport have been loaded
8669
- * - Any fade transitions (e.g. for labels) have completed
8670
- *
8671
- * @returns A function to unsubscribe from the listener
8672
- *
8673
- * @event
8674
- * @example
8675
- * ```typescript
8676
- * const unsubscribe = felt.onMapIdle({ handler: () => console.log("map is idle") });
8677
- *
8678
- * // later on...
8679
- * unsubscribe();
8680
- * ```
8681
- */
8682
- onMapIdle(args: {
8683
- handler: () => void;
8684
- }): VoidFunction;
8685
- }
8686
-
8687
- /**
8688
- * This is the main interface for interacting with a Felt map.
8689
- *
8690
- * This interface is composed of the various controllers, each having a
8691
- * different area of responsibility.
8692
- *
8693
- * All the methods are listed here, but each controller is documented on its
8694
- * own to make it easier to find related methods and events.
8695
- *
8696
- * @group Controller
8697
- * @public
8698
- */
8699
- interface FeltController extends ViewportController, UiController, LayersController, ElementsController, SelectionController, InteractionsController, ToolsController, InteractionsController, MiscController {
8700
- /**
8701
- * The iframe element containing the Felt map, if it is an embedded map.
8702
- *
8703
- * @readonly
8704
- */
8705
- iframe: HTMLIFrameElement | null;
8706
- }
8707
-
8708
- 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, MultiPointGeometry 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, GetLayerHistogramParams as aA, GetLayerPrecomputedCalculationParams as aB, GridConfig as aC, GridType as aD, MultiAggregationConfig as aE, PrecomputedAggregationMethod as aF, ValueConfiguration as aG, LayersController as aH, MapDetails as aI, MiscController as aJ, ElementGroupNode as aK, ElementNode as aL, EntityNode as aM, FeatureNode as aN, FeatureSelection as aO, LayerGroupNode as aP, LayerNode as aQ, SelectionController as aR, FeltBoundary as aS, FeltZoom as aT, GeoJsonFeature as aU, GeoJsonGeometry as aV, GeoJsonProperties as aW, LatLng as aX, LineStringGeometry as aY, LngLatTuple as aZ, MultiLineStringGeometry 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, AggregationConfig as au, AggregationMethod as av, GetLayerCalculationParams as aw, GetLayerCategoriesGroup as ax, GetLayerCategoriesParams as ay, GetLayerHistogramBin as az, CircleElementUpdate as b, MultiPolygonGeometry as b0, PointGeometry as b1, PolygonGeometry as b2, SetVisibilityRequest as b3, SortConfig as b4, SortDirection as b5, CircleToolSettings as b6, ConfigurableToolType as b7, HighlighterToolSettings as b8, InputToolSettings as b9, LineToolSettings as ba, MarkerToolSettings as bb, NoteToolSettings as bc, PinToolSettings as bd, PlaceFrame as be, PlaceSymbol as bf, PolygonToolSettings as bg, RouteToolSettings as bh, TextToolSettings as bi, ToolSettingsChangeEvent as bj, ToolSettingsMap as bk, ToolType as bl, ToolsController as bm, UiOnMapInteractionsOptions as bn, UiController as bo, SetViewportCenterZoomParams as bp, ViewportConstraints as bq, ViewportFitBoundsParams as br, ViewportState as bs, ViewportController as bt, UnwrapPromise as bu, UnionToIntersection as bv, PromiseOrNot as bw, 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 };