@feltmaps/js-sdk 1.5.0-next.5 → 1.5.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +254 -11
- package/dist/client.d.ts +254 -11
- package/dist/client.js +1 -1
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +501 -23
- package/dist/handler.d.ts +501 -23
- package/dist/handler.js +1 -1
- package/dist/{types-BKxKmuZn.d.cts → types-XLCA2cX-.d.cts} +764 -16
- package/dist/{types-BKxKmuZn.d.ts → types-XLCA2cX-.d.ts} +764 -16
- package/handler.d.ts +501 -23
- package/handler.js +1 -1
- package/package.json +1 -1
- package/{types-BKxKmuZn.d.ts → types-XLCA2cX-.d.ts} +764 -16
|
@@ -378,7 +378,7 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
|
|
|
378
378
|
attributes?: Record<string, unknown> | undefined;
|
|
379
379
|
opacity?: number | undefined;
|
|
380
380
|
}>;
|
|
381
|
-
declare const PlaceReadSchema: z.ZodObject<
|
|
381
|
+
declare const PlaceReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
382
382
|
id: z.ZodString;
|
|
383
383
|
groupId: z.ZodNullable<z.ZodString>;
|
|
384
384
|
color: z.ZodString;
|
|
@@ -393,9 +393,10 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
|
|
|
393
393
|
symbol: z.ZodString;
|
|
394
394
|
frame: z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>;
|
|
395
395
|
hideLabel: z.ZodBoolean;
|
|
396
|
-
}>, "
|
|
396
|
+
}>, "strip", z.ZodTypeAny, {
|
|
397
397
|
symbol: string;
|
|
398
398
|
type: "Place";
|
|
399
|
+
coordinates: [number, number];
|
|
399
400
|
id: string;
|
|
400
401
|
groupId: string | null;
|
|
401
402
|
color: string;
|
|
@@ -408,6 +409,7 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
|
|
|
408
409
|
}, {
|
|
409
410
|
symbol: string;
|
|
410
411
|
type: "Place";
|
|
412
|
+
coordinates: [number, number];
|
|
411
413
|
id: string;
|
|
412
414
|
groupId: string | null;
|
|
413
415
|
color: string;
|
|
@@ -515,7 +517,7 @@ declare const PolygonReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obj
|
|
|
515
517
|
fillOpacity: number;
|
|
516
518
|
areaMarker: boolean;
|
|
517
519
|
}>;
|
|
518
|
-
declare const CircleReadSchema: z.ZodObject<
|
|
520
|
+
declare const CircleReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
519
521
|
id: z.ZodString;
|
|
520
522
|
groupId: z.ZodNullable<z.ZodString>;
|
|
521
523
|
color: z.ZodString;
|
|
@@ -536,8 +538,9 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
|
|
|
536
538
|
radiusDisplayUnit: z.ZodNullable<z.ZodEnum<["meter", "kilometer", "foot", "mile"]>>;
|
|
537
539
|
fillOpacity: z.ZodNumber;
|
|
538
540
|
radiusMarker: z.ZodBoolean;
|
|
539
|
-
}>, "
|
|
541
|
+
}>, "strip", z.ZodTypeAny, {
|
|
540
542
|
type: "Circle";
|
|
543
|
+
coordinates: [number, number];
|
|
541
544
|
id: string;
|
|
542
545
|
groupId: string | null;
|
|
543
546
|
color: string;
|
|
@@ -555,6 +558,7 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
|
|
|
555
558
|
radiusMarker: boolean;
|
|
556
559
|
}, {
|
|
557
560
|
type: "Circle";
|
|
561
|
+
coordinates: [number, number];
|
|
558
562
|
id: string;
|
|
559
563
|
groupId: string | null;
|
|
560
564
|
color: string;
|
|
@@ -1317,7 +1321,7 @@ declare const GetElementGroupsConstraintSchema: z.ZodObject<{
|
|
|
1317
1321
|
ids?: string[] | undefined;
|
|
1318
1322
|
}>;
|
|
1319
1323
|
/**
|
|
1320
|
-
* The parameters for the `onElementChange`
|
|
1324
|
+
* The parameters for the `onElementChange` and the `onElementCreate` listeners.
|
|
1321
1325
|
*
|
|
1322
1326
|
* @group Elements
|
|
1323
1327
|
*/
|
|
@@ -1326,6 +1330,22 @@ interface ElementChangeCallbackParams {
|
|
|
1326
1330
|
* The new data for the element or null if the element was removed.
|
|
1327
1331
|
*/
|
|
1328
1332
|
element: Element | null;
|
|
1333
|
+
/**
|
|
1334
|
+
* Whether or not this element is still being created by a drawing tool.
|
|
1335
|
+
*
|
|
1336
|
+
* For example, if the user begins drawing a polygon, they need to place
|
|
1337
|
+
* multiple points until they've ultimately completed the polygon. All
|
|
1338
|
+
* the time they are still placing points, this will be true.
|
|
1339
|
+
*
|
|
1340
|
+
* For elements that require text entry (such as Places, Text and Notes)
|
|
1341
|
+
* this will be true all the time the user is typing text until the point
|
|
1342
|
+
* at which the user finishes, by pressing Escape for example.
|
|
1343
|
+
*
|
|
1344
|
+
* If the user is editing an existing element, this will be false.
|
|
1345
|
+
*
|
|
1346
|
+
* For elements that are created programatically, this will be false.
|
|
1347
|
+
*/
|
|
1348
|
+
isBeingCreated: boolean;
|
|
1329
1349
|
}
|
|
1330
1350
|
/**
|
|
1331
1351
|
* The parameters for the `onElementGroupChange` listener.
|
|
@@ -1350,22 +1370,40 @@ interface LatLng {
|
|
|
1350
1370
|
* GeoJSON.
|
|
1351
1371
|
*/
|
|
1352
1372
|
type LngLatTuple = [longitude: number, latitude: number];
|
|
1373
|
+
interface PointGeometry extends zInfer<typeof PointGeometrySchema> {
|
|
1374
|
+
}
|
|
1353
1375
|
/**
|
|
1354
1376
|
* A GeoJSON point geometry.
|
|
1355
1377
|
*/
|
|
1356
|
-
|
|
1378
|
+
declare const PointGeometrySchema: z.ZodObject<{
|
|
1379
|
+
type: z.ZodLiteral<"Point">;
|
|
1380
|
+
coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
1381
|
+
}, "strip", z.ZodTypeAny, {
|
|
1357
1382
|
type: "Point";
|
|
1358
|
-
coordinates:
|
|
1359
|
-
}
|
|
1383
|
+
coordinates: [number, number];
|
|
1384
|
+
}, {
|
|
1385
|
+
type: "Point";
|
|
1386
|
+
coordinates: [number, number];
|
|
1387
|
+
}>;
|
|
1388
|
+
interface PolygonGeometry extends zInfer<typeof PolygonGeometrySchema> {
|
|
1389
|
+
}
|
|
1360
1390
|
/**
|
|
1361
1391
|
* A GeoJSON polygon geometry.
|
|
1362
1392
|
*/
|
|
1363
|
-
|
|
1393
|
+
declare const PolygonGeometrySchema: z.ZodObject<{
|
|
1394
|
+
type: z.ZodLiteral<"Polygon">;
|
|
1395
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
1396
|
+
}, "strip", z.ZodTypeAny, {
|
|
1364
1397
|
type: "Polygon";
|
|
1365
|
-
coordinates:
|
|
1366
|
-
}
|
|
1398
|
+
coordinates: [number, number][][];
|
|
1399
|
+
}, {
|
|
1400
|
+
type: "Polygon";
|
|
1401
|
+
coordinates: [number, number][][];
|
|
1402
|
+
}>;
|
|
1367
1403
|
/**
|
|
1368
1404
|
* A GeoJSON multi-polygon geometry.
|
|
1405
|
+
*
|
|
1406
|
+
* @interface
|
|
1369
1407
|
*/
|
|
1370
1408
|
type MultiPolygonGeometry = {
|
|
1371
1409
|
type: "MultiPolygon";
|
|
@@ -1373,6 +1411,8 @@ type MultiPolygonGeometry = {
|
|
|
1373
1411
|
};
|
|
1374
1412
|
/**
|
|
1375
1413
|
* A GeoJSON line string geometry.
|
|
1414
|
+
*
|
|
1415
|
+
* @interface
|
|
1376
1416
|
*/
|
|
1377
1417
|
type LineStringGeometry = {
|
|
1378
1418
|
type: "LineString";
|
|
@@ -1380,6 +1420,8 @@ type LineStringGeometry = {
|
|
|
1380
1420
|
};
|
|
1381
1421
|
/**
|
|
1382
1422
|
* A GeoJSON multi-line string geometry.
|
|
1423
|
+
*
|
|
1424
|
+
* @interface
|
|
1383
1425
|
*/
|
|
1384
1426
|
type MultiLineStringGeometry = {
|
|
1385
1427
|
type: "MultiLineString";
|
|
@@ -1442,6 +1484,40 @@ declare const SetVisibilityRequestSchema: z.ZodObject<{
|
|
|
1442
1484
|
show?: string[] | undefined;
|
|
1443
1485
|
hide?: string[] | undefined;
|
|
1444
1486
|
}>;
|
|
1487
|
+
/**
|
|
1488
|
+
* Specifies the direction to sort data in
|
|
1489
|
+
*
|
|
1490
|
+
* @group Types
|
|
1491
|
+
*/
|
|
1492
|
+
type SortDirection = z.infer<typeof SortDirectionSchema>;
|
|
1493
|
+
/** @ignore */
|
|
1494
|
+
declare const SortDirectionSchema: z.ZodEnum<["asc", "desc"]>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Configuration for sorting data by a specific attribute
|
|
1497
|
+
*
|
|
1498
|
+
* @group Types
|
|
1499
|
+
*/
|
|
1500
|
+
interface SortConfig extends zInfer<typeof SortConfigSchema> {
|
|
1501
|
+
}
|
|
1502
|
+
/** @ignore */
|
|
1503
|
+
declare const SortConfigSchema: z.ZodObject<{
|
|
1504
|
+
/**
|
|
1505
|
+
* The attribute to sort by. What this represents depends on the context.
|
|
1506
|
+
* For instance, when sorting features in a data table, the attribute is
|
|
1507
|
+
* the column to sort by.
|
|
1508
|
+
*/
|
|
1509
|
+
attribute: z.ZodString;
|
|
1510
|
+
/**
|
|
1511
|
+
* The direction to sort in
|
|
1512
|
+
*/
|
|
1513
|
+
direction: z.ZodEnum<["asc", "desc"]>;
|
|
1514
|
+
}, "strip", z.ZodTypeAny, {
|
|
1515
|
+
attribute: string;
|
|
1516
|
+
direction: "asc" | "desc";
|
|
1517
|
+
}, {
|
|
1518
|
+
attribute: string;
|
|
1519
|
+
direction: "asc" | "desc";
|
|
1520
|
+
}>;
|
|
1445
1521
|
|
|
1446
1522
|
/**
|
|
1447
1523
|
* A feature is a single geographical item in a layer.
|
|
@@ -1866,6 +1942,31 @@ declare const FilterLogicGateSchema: z.ZodEnum<["and", "or"]>;
|
|
|
1866
1942
|
type FilterExpression = z.infer<typeof FilterExpressionSchema>;
|
|
1867
1943
|
declare const FilterExpressionSchema: 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>]>;
|
|
1868
1944
|
/**
|
|
1945
|
+
* A `FilterTernary` is a tree structure for combining expressions with logical operators.
|
|
1946
|
+
*
|
|
1947
|
+
* When combining three or more conditions, you must use proper nesting rather than a flat list.
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* // A simple filter with a single condition
|
|
1952
|
+
* const filter = [
|
|
1953
|
+
* ["AREA", "gt", 30_000],
|
|
1954
|
+
* "and",
|
|
1955
|
+
* ["COLOR", "eq", "red"]
|
|
1956
|
+
* ]
|
|
1957
|
+
*
|
|
1958
|
+
* // A complex filter with multiple conditions
|
|
1959
|
+
* const filter = [
|
|
1960
|
+
* ["AREA", "gt", 30_000],
|
|
1961
|
+
* "and",
|
|
1962
|
+
* [
|
|
1963
|
+
* ["COLOR", "eq", "red"],
|
|
1964
|
+
* "or",
|
|
1965
|
+
* ["TYPE", "eq", "residential"]
|
|
1966
|
+
* ]
|
|
1967
|
+
* ]
|
|
1968
|
+
* ```
|
|
1969
|
+
*
|
|
1869
1970
|
* @group Filters
|
|
1870
1971
|
*/
|
|
1871
1972
|
type FilterTernary = [
|
|
@@ -1878,6 +1979,12 @@ type FilterTernary = [
|
|
|
1878
1979
|
* Filters can be used to change which features in a layer are rendered. Filters can be
|
|
1879
1980
|
* applied to a layer by the `setLayerFilters` method on the Felt controller.
|
|
1880
1981
|
*
|
|
1982
|
+
* Filters use a tree structure for combining expressions with logical operators, called a
|
|
1983
|
+
* {@link FilterTernary}. When combining three or more conditions, you must use proper nesting
|
|
1984
|
+
* rather than a flat list.
|
|
1985
|
+
*
|
|
1986
|
+
* See the examples below for the correct structure to use when building complex filters.
|
|
1987
|
+
*
|
|
1881
1988
|
* @remarks
|
|
1882
1989
|
* The possible operators are:
|
|
1883
1990
|
* - `lt`: Less than
|
|
@@ -1895,17 +2002,82 @@ type FilterTernary = [
|
|
|
1895
2002
|
*
|
|
1896
2003
|
* @example
|
|
1897
2004
|
* ```typescript
|
|
1898
|
-
* //
|
|
2005
|
+
* // 1. Simple filter: single condition
|
|
1899
2006
|
* felt.setLayerFilters({
|
|
1900
2007
|
* layerId: "layer-1",
|
|
1901
2008
|
* filters: ["AREA", "gt", 30_000],
|
|
1902
2009
|
* });
|
|
1903
2010
|
*
|
|
1904
|
-
* //
|
|
2011
|
+
* // 2. Basic compound filter: two conditions with AND
|
|
1905
2012
|
* felt.setLayerFilters({
|
|
1906
2013
|
* layerId: "layer-1",
|
|
1907
|
-
* filters: [
|
|
1908
|
-
*
|
|
2014
|
+
* filters: [
|
|
2015
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2016
|
+
* "and", // Logic operator
|
|
2017
|
+
* ["COLOR", "eq", "red"] // Second condition
|
|
2018
|
+
* ]
|
|
2019
|
+
* });
|
|
2020
|
+
*
|
|
2021
|
+
* // 3. Complex filter: three or more conditions require nesting
|
|
2022
|
+
* // ⚠️ IMPORTANT: Filters use a tree structure, not a flat list
|
|
2023
|
+
* felt.setLayerFilters({
|
|
2024
|
+
* layerId: "layer-1",
|
|
2025
|
+
* filters: [
|
|
2026
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2027
|
+
* "and", // First logic operator
|
|
2028
|
+
* [ // Nested group starts
|
|
2029
|
+
* ["COLOR", "eq", "red"], // Second condition
|
|
2030
|
+
* "and", // Second logic operator
|
|
2031
|
+
* ["TYPE", "eq", "residential"] // Third condition
|
|
2032
|
+
* ] // Nested group ends
|
|
2033
|
+
* ]
|
|
2034
|
+
* });
|
|
2035
|
+
*
|
|
2036
|
+
* // 4. Even more complex: four conditions with proper nesting
|
|
2037
|
+
* // Visual structure:
|
|
2038
|
+
* // AND
|
|
2039
|
+
* // / \
|
|
2040
|
+
* // condition AND
|
|
2041
|
+
* // / \
|
|
2042
|
+
* // condition AND
|
|
2043
|
+
* // / \
|
|
2044
|
+
* // condition condition
|
|
2045
|
+
* felt.setLayerFilters({
|
|
2046
|
+
* layerId: "layer-1",
|
|
2047
|
+
* filters: [
|
|
2048
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2049
|
+
* "and",
|
|
2050
|
+
* [
|
|
2051
|
+
* ["COLOR", "eq", "red"], // Second condition
|
|
2052
|
+
* "and",
|
|
2053
|
+
* [
|
|
2054
|
+
* ["TYPE", "eq", "residential"], // Third condition
|
|
2055
|
+
* "and",
|
|
2056
|
+
* ["YEAR", "gt", 2000] // Fourth condition
|
|
2057
|
+
* ]
|
|
2058
|
+
* ]
|
|
2059
|
+
* ]
|
|
2060
|
+
* });
|
|
2061
|
+
*
|
|
2062
|
+
* // 5. Mixed operators: combining AND and OR
|
|
2063
|
+
* // Visual structure:
|
|
2064
|
+
* // AND
|
|
2065
|
+
* // / \
|
|
2066
|
+
* // condition OR
|
|
2067
|
+
* // / \
|
|
2068
|
+
* // condition condition
|
|
2069
|
+
* felt.setLayerFilters({
|
|
2070
|
+
* layerId: "layer-1",
|
|
2071
|
+
* filters: [
|
|
2072
|
+
* ["AREA", "gt", 30_000], // Must have large area
|
|
2073
|
+
* "and",
|
|
2074
|
+
* [
|
|
2075
|
+
* ["COLOR", "eq", "red"], // Must be either red
|
|
2076
|
+
* "or",
|
|
2077
|
+
* ["TYPE", "eq", "residential"] // OR residential type
|
|
2078
|
+
* ]
|
|
2079
|
+
* ]
|
|
2080
|
+
* });
|
|
1909
2081
|
* ```
|
|
1910
2082
|
*
|
|
1911
2083
|
* @group Filters
|
|
@@ -1945,6 +2117,582 @@ interface LayerFilters {
|
|
|
1945
2117
|
combined: Filters;
|
|
1946
2118
|
}
|
|
1947
2119
|
|
|
2120
|
+
declare const AggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
2121
|
+
declare const AggregationConfigSchema: z.ZodObject<{
|
|
2122
|
+
/**
|
|
2123
|
+
* The operation to use on the values from the features in the layer
|
|
2124
|
+
*/
|
|
2125
|
+
method: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
2126
|
+
/**
|
|
2127
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2128
|
+
*/
|
|
2129
|
+
attribute: z.ZodString;
|
|
2130
|
+
}, "strip", z.ZodTypeAny, {
|
|
2131
|
+
attribute: string;
|
|
2132
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2133
|
+
}, {
|
|
2134
|
+
attribute: string;
|
|
2135
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2136
|
+
}>;
|
|
2137
|
+
declare const MutliAggregationConfigSchema: z.ZodObject<{
|
|
2138
|
+
/**
|
|
2139
|
+
* The operations to use on the values from the features in the layer
|
|
2140
|
+
*/
|
|
2141
|
+
methods: z.ZodArray<z.ZodUnion<[z.ZodEnum<["avg", "max", "min", "sum", "median"]>, z.ZodLiteral<"count">]>, "many">;
|
|
2142
|
+
/**
|
|
2143
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2144
|
+
*/
|
|
2145
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
2146
|
+
}, "strip", z.ZodTypeAny, {
|
|
2147
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2148
|
+
attribute?: string | undefined;
|
|
2149
|
+
}, {
|
|
2150
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2151
|
+
attribute?: string | undefined;
|
|
2152
|
+
}>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Defines how to aggregate a value across features in a layer.
|
|
2155
|
+
*/
|
|
2156
|
+
interface AggregationConfig extends zInfer<typeof AggregationConfigSchema> {
|
|
2157
|
+
/**
|
|
2158
|
+
* The method to use for the aggregation.
|
|
2159
|
+
*/
|
|
2160
|
+
method: AggregationMethod;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* The method to use for the aggregation.
|
|
2164
|
+
*/
|
|
2165
|
+
type AggregationMethod = z.infer<typeof AggregateMethodSchema>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Defines how to aggregate a value across features in a layer with multiple aggregations
|
|
2168
|
+
* returned at once.
|
|
2169
|
+
*/
|
|
2170
|
+
interface MultiAggregationConfig<T extends AggregationMethod | "count"> extends zInfer<typeof MutliAggregationConfigSchema> {
|
|
2171
|
+
methods: T[];
|
|
2172
|
+
/**
|
|
2173
|
+
* The attribute to use for the aggregation when aggregations other than "count" are used.
|
|
2174
|
+
*
|
|
2175
|
+
* This can be omitted if the only aggregation is "count", but must be a numeric attribute
|
|
2176
|
+
* otherwise.
|
|
2177
|
+
*/
|
|
2178
|
+
attribute?: string;
|
|
2179
|
+
}
|
|
2180
|
+
declare const ValueConfigurationSchema: z.ZodObject<{
|
|
2181
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2182
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2183
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2184
|
+
}, "strip", z.ZodTypeAny, {
|
|
2185
|
+
type: "Polygon";
|
|
2186
|
+
coordinates: [number, number][][];
|
|
2187
|
+
}, {
|
|
2188
|
+
type: "Polygon";
|
|
2189
|
+
coordinates: [number, number][][];
|
|
2190
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2191
|
+
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]>>;
|
|
2192
|
+
aggregation: z.ZodOptional<z.ZodObject<{
|
|
2193
|
+
/**
|
|
2194
|
+
* The operation to use on the values from the features in the layer
|
|
2195
|
+
*/
|
|
2196
|
+
method: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
2197
|
+
/**
|
|
2198
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2199
|
+
*/
|
|
2200
|
+
attribute: z.ZodString;
|
|
2201
|
+
}, "strip", z.ZodTypeAny, {
|
|
2202
|
+
attribute: string;
|
|
2203
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2204
|
+
}, {
|
|
2205
|
+
attribute: string;
|
|
2206
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2207
|
+
}>>;
|
|
2208
|
+
}, "strip", z.ZodTypeAny, {
|
|
2209
|
+
boundary?: [number, number][] | {
|
|
2210
|
+
type: "Polygon";
|
|
2211
|
+
coordinates: [number, number][][];
|
|
2212
|
+
} | [number, number, number, number] | undefined;
|
|
2213
|
+
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;
|
|
2214
|
+
aggregation?: {
|
|
2215
|
+
attribute: string;
|
|
2216
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2217
|
+
} | undefined;
|
|
2218
|
+
}, {
|
|
2219
|
+
boundary?: [number, number][] | {
|
|
2220
|
+
type: "Polygon";
|
|
2221
|
+
coordinates: [number, number][][];
|
|
2222
|
+
} | [number, number, number, number] | undefined;
|
|
2223
|
+
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;
|
|
2224
|
+
aggregation?: {
|
|
2225
|
+
attribute: string;
|
|
2226
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2227
|
+
} | undefined;
|
|
2228
|
+
}>;
|
|
2229
|
+
/**
|
|
2230
|
+
* Configuration for filtering and aggregating values across features.
|
|
2231
|
+
*
|
|
2232
|
+
* This can be used to restrict the features considered for aggregation via the `boundary`
|
|
2233
|
+
* and `filters` properties.
|
|
2234
|
+
*
|
|
2235
|
+
* It can also be used to specify how to aggregate the values via the `aggregation` property.
|
|
2236
|
+
*/
|
|
2237
|
+
interface ValueConfiguration extends zInfer<typeof ValueConfigurationSchema> {
|
|
2238
|
+
/**
|
|
2239
|
+
* A spatial boundary to filter what gets counted or aggregated, while still including
|
|
2240
|
+
* all possible categories or bin ranges in the results.
|
|
2241
|
+
*/
|
|
2242
|
+
boundary?: PolygonGeometry | LngLatTuple[] | FeltBoundary;
|
|
2243
|
+
/**
|
|
2244
|
+
* Attribute filters to determine what gets counted or aggregated, while still including
|
|
2245
|
+
* all possible categories or bin ranges in the results.
|
|
2246
|
+
*/
|
|
2247
|
+
filters?: Filters;
|
|
2248
|
+
/**
|
|
2249
|
+
* Specifies how to aggregate values within each category or bin. When omitted,
|
|
2250
|
+
* features are counted. When specified, the chosen calculation (avg, sum, etc.)
|
|
2251
|
+
* is performed on the specified attribute.
|
|
2252
|
+
*
|
|
2253
|
+
* For example, instead of counting buildings in each category, you might want
|
|
2254
|
+
* to sum their square footage or average their assessed values.
|
|
2255
|
+
*/
|
|
2256
|
+
aggregation?: AggregationConfig;
|
|
2257
|
+
}
|
|
2258
|
+
declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
|
|
2259
|
+
/**
|
|
2260
|
+
* The ID of the layer to get categories from.
|
|
2261
|
+
*/
|
|
2262
|
+
layerId: z.ZodString;
|
|
2263
|
+
/**
|
|
2264
|
+
* The attribute to use for categorization.
|
|
2265
|
+
*/
|
|
2266
|
+
attribute: z.ZodString;
|
|
2267
|
+
/**
|
|
2268
|
+
* The maximum number of categories to return.
|
|
2269
|
+
*/
|
|
2270
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2271
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2272
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2273
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2274
|
+
}, "strip", z.ZodTypeAny, {
|
|
2275
|
+
type: "Polygon";
|
|
2276
|
+
coordinates: [number, number][][];
|
|
2277
|
+
}, {
|
|
2278
|
+
type: "Polygon";
|
|
2279
|
+
coordinates: [number, number][][];
|
|
2280
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2281
|
+
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]>>;
|
|
2282
|
+
values: z.ZodOptional<z.ZodObject<{
|
|
2283
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2284
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2285
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2286
|
+
}, "strip", z.ZodTypeAny, {
|
|
2287
|
+
type: "Polygon";
|
|
2288
|
+
coordinates: [number, number][][];
|
|
2289
|
+
}, {
|
|
2290
|
+
type: "Polygon";
|
|
2291
|
+
coordinates: [number, number][][];
|
|
2292
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2293
|
+
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]>>;
|
|
2294
|
+
aggregation: z.ZodOptional<z.ZodObject<{
|
|
2295
|
+
/**
|
|
2296
|
+
* The operation to use on the values from the features in the layer
|
|
2297
|
+
*/
|
|
2298
|
+
method: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
2299
|
+
/**
|
|
2300
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2301
|
+
*/
|
|
2302
|
+
attribute: z.ZodString;
|
|
2303
|
+
}, "strip", z.ZodTypeAny, {
|
|
2304
|
+
attribute: string;
|
|
2305
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2306
|
+
}, {
|
|
2307
|
+
attribute: string;
|
|
2308
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2309
|
+
}>>;
|
|
2310
|
+
}, "strip", z.ZodTypeAny, {
|
|
2311
|
+
boundary?: [number, number][] | {
|
|
2312
|
+
type: "Polygon";
|
|
2313
|
+
coordinates: [number, number][][];
|
|
2314
|
+
} | [number, number, number, number] | undefined;
|
|
2315
|
+
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;
|
|
2316
|
+
aggregation?: {
|
|
2317
|
+
attribute: string;
|
|
2318
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2319
|
+
} | undefined;
|
|
2320
|
+
}, {
|
|
2321
|
+
boundary?: [number, number][] | {
|
|
2322
|
+
type: "Polygon";
|
|
2323
|
+
coordinates: [number, number][][];
|
|
2324
|
+
} | [number, number, number, number] | undefined;
|
|
2325
|
+
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;
|
|
2326
|
+
aggregation?: {
|
|
2327
|
+
attribute: string;
|
|
2328
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2329
|
+
} | undefined;
|
|
2330
|
+
}>>;
|
|
2331
|
+
}, "strip", z.ZodTypeAny, {
|
|
2332
|
+
attribute: string;
|
|
2333
|
+
layerId: string;
|
|
2334
|
+
values?: {
|
|
2335
|
+
boundary?: [number, number][] | {
|
|
2336
|
+
type: "Polygon";
|
|
2337
|
+
coordinates: [number, number][][];
|
|
2338
|
+
} | [number, number, number, number] | undefined;
|
|
2339
|
+
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;
|
|
2340
|
+
aggregation?: {
|
|
2341
|
+
attribute: string;
|
|
2342
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2343
|
+
} | undefined;
|
|
2344
|
+
} | undefined;
|
|
2345
|
+
boundary?: [number, number][] | {
|
|
2346
|
+
type: "Polygon";
|
|
2347
|
+
coordinates: [number, number][][];
|
|
2348
|
+
} | [number, number, number, number] | undefined;
|
|
2349
|
+
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;
|
|
2350
|
+
limit?: number | undefined;
|
|
2351
|
+
}, {
|
|
2352
|
+
attribute: string;
|
|
2353
|
+
layerId: string;
|
|
2354
|
+
values?: {
|
|
2355
|
+
boundary?: [number, number][] | {
|
|
2356
|
+
type: "Polygon";
|
|
2357
|
+
coordinates: [number, number][][];
|
|
2358
|
+
} | [number, number, number, number] | undefined;
|
|
2359
|
+
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;
|
|
2360
|
+
aggregation?: {
|
|
2361
|
+
attribute: string;
|
|
2362
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2363
|
+
} | undefined;
|
|
2364
|
+
} | undefined;
|
|
2365
|
+
boundary?: [number, number][] | {
|
|
2366
|
+
type: "Polygon";
|
|
2367
|
+
coordinates: [number, number][][];
|
|
2368
|
+
} | [number, number, number, number] | undefined;
|
|
2369
|
+
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;
|
|
2370
|
+
limit?: number | undefined;
|
|
2371
|
+
}>;
|
|
2372
|
+
/**
|
|
2373
|
+
* The parameters for getting categories from a layer, passed to
|
|
2374
|
+
* the {@link LayersController.getCategoryData} method.
|
|
2375
|
+
*/
|
|
2376
|
+
interface GetLayerCategoriesParams extends zInfer<typeof GetLayerCategoriesParamsSchema> {
|
|
2377
|
+
/**
|
|
2378
|
+
* Attribute filters to determine what gets counted or aggregated.
|
|
2379
|
+
*/
|
|
2380
|
+
filters?: Filters;
|
|
2381
|
+
/**
|
|
2382
|
+
* A spatial boundary to filter what gets counted or aggregated. This can be either
|
|
2383
|
+
* a [w, s, e, n] bounding box, a GeoJSON Polygon geometry, or a list of coordinates
|
|
2384
|
+
* that form a polyline.
|
|
2385
|
+
*/
|
|
2386
|
+
boundary?: PolygonGeometry | LngLatTuple[] | FeltBoundary;
|
|
2387
|
+
/**
|
|
2388
|
+
* Configuration for filtering and aggregating values while preserving the full set of
|
|
2389
|
+
* categories in the results.
|
|
2390
|
+
*
|
|
2391
|
+
* This is particularly useful when you want to compare different subsets of data while
|
|
2392
|
+
* maintaining consistent categories. For example:
|
|
2393
|
+
*
|
|
2394
|
+
* - Show all building types in a city, but only count recent buildings in each type
|
|
2395
|
+
* - Keep all neighborhood categories but only sum up residential square footage
|
|
2396
|
+
*
|
|
2397
|
+
* Unlike top-level filters which affect both what categories appear AND their values,
|
|
2398
|
+
* filters in this configuration only affect the values while keeping all possible
|
|
2399
|
+
* categories in the results.
|
|
2400
|
+
*/
|
|
2401
|
+
values?: ValueConfiguration;
|
|
2402
|
+
}
|
|
2403
|
+
declare const GetLayerCategoriesGroupSchema: z.ZodObject<{
|
|
2404
|
+
/**
|
|
2405
|
+
* The category for which the value was calculated.
|
|
2406
|
+
*/
|
|
2407
|
+
key: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>;
|
|
2408
|
+
/**
|
|
2409
|
+
* The value calculated for the category, whether a count, sum, average, etc.
|
|
2410
|
+
*
|
|
2411
|
+
* `null` is returned if there are no features in the category as opposed to zero,
|
|
2412
|
+
* so as not to confuse with a real zero value from some aggregation.
|
|
2413
|
+
*/
|
|
2414
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
2415
|
+
}, "strip", z.ZodTypeAny, {
|
|
2416
|
+
value: number | null;
|
|
2417
|
+
key: string | number | boolean;
|
|
2418
|
+
}, {
|
|
2419
|
+
value: number | null;
|
|
2420
|
+
key: string | number | boolean;
|
|
2421
|
+
}>;
|
|
2422
|
+
/**
|
|
2423
|
+
* A single category from the response from the {@link LayersController.getCategoryData} method.
|
|
2424
|
+
*/
|
|
2425
|
+
interface GetLayerCategoriesGroup extends zInfer<typeof GetLayerCategoriesGroupSchema> {
|
|
2426
|
+
}
|
|
2427
|
+
declare const GetLayerHistogramParamsSchema: z.ZodObject<{
|
|
2428
|
+
layerId: z.ZodString;
|
|
2429
|
+
attribute: z.ZodString;
|
|
2430
|
+
steps: z.ZodUnion<[z.ZodObject<{
|
|
2431
|
+
type: z.ZodLiteral<"equal-intervals">;
|
|
2432
|
+
count: z.ZodNumber;
|
|
2433
|
+
}, "strip", z.ZodTypeAny, {
|
|
2434
|
+
type: "equal-intervals";
|
|
2435
|
+
count: number;
|
|
2436
|
+
}, {
|
|
2437
|
+
type: "equal-intervals";
|
|
2438
|
+
count: number;
|
|
2439
|
+
}>, z.ZodObject<{
|
|
2440
|
+
type: z.ZodLiteral<"time-interval">;
|
|
2441
|
+
interval: z.ZodEnum<["hour", "day", "week", "month", "year"]>;
|
|
2442
|
+
}, "strip", z.ZodTypeAny, {
|
|
2443
|
+
type: "time-interval";
|
|
2444
|
+
interval: "hour" | "day" | "week" | "month" | "year";
|
|
2445
|
+
}, {
|
|
2446
|
+
type: "time-interval";
|
|
2447
|
+
interval: "hour" | "day" | "week" | "month" | "year";
|
|
2448
|
+
}>, z.ZodArray<z.ZodNumber, "many">]>;
|
|
2449
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2450
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2451
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2452
|
+
}, "strip", z.ZodTypeAny, {
|
|
2453
|
+
type: "Polygon";
|
|
2454
|
+
coordinates: [number, number][][];
|
|
2455
|
+
}, {
|
|
2456
|
+
type: "Polygon";
|
|
2457
|
+
coordinates: [number, number][][];
|
|
2458
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2459
|
+
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]>>;
|
|
2460
|
+
/**
|
|
2461
|
+
* Configuration for filtering and aggregating values while preserving the full set of
|
|
2462
|
+
* bin ranges in the results.
|
|
2463
|
+
*
|
|
2464
|
+
* This is particularly useful when you want to compare different subsets of data while
|
|
2465
|
+
* maintaining consistent ranges. For example:
|
|
2466
|
+
*
|
|
2467
|
+
* - Use the same height ranges for comparing old vs new buildings
|
|
2468
|
+
*
|
|
2469
|
+
* Unlike top-level filters which affect both what ranges appear AND their values,
|
|
2470
|
+
* filters in this configuration only affect the values while keeping all possible
|
|
2471
|
+
* ranges in the results.
|
|
2472
|
+
*/
|
|
2473
|
+
values: z.ZodOptional<z.ZodObject<{
|
|
2474
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2475
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2476
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2477
|
+
}, "strip", z.ZodTypeAny, {
|
|
2478
|
+
type: "Polygon";
|
|
2479
|
+
coordinates: [number, number][][];
|
|
2480
|
+
}, {
|
|
2481
|
+
type: "Polygon";
|
|
2482
|
+
coordinates: [number, number][][];
|
|
2483
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2484
|
+
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]>>;
|
|
2485
|
+
aggregation: z.ZodOptional<z.ZodObject<{
|
|
2486
|
+
/**
|
|
2487
|
+
* The operation to use on the values from the features in the layer
|
|
2488
|
+
*/
|
|
2489
|
+
method: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
2490
|
+
/**
|
|
2491
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2492
|
+
*/
|
|
2493
|
+
attribute: z.ZodString;
|
|
2494
|
+
}, "strip", z.ZodTypeAny, {
|
|
2495
|
+
attribute: string;
|
|
2496
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2497
|
+
}, {
|
|
2498
|
+
attribute: string;
|
|
2499
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2500
|
+
}>>;
|
|
2501
|
+
}, "strip", z.ZodTypeAny, {
|
|
2502
|
+
boundary?: [number, number][] | {
|
|
2503
|
+
type: "Polygon";
|
|
2504
|
+
coordinates: [number, number][][];
|
|
2505
|
+
} | [number, number, number, number] | undefined;
|
|
2506
|
+
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;
|
|
2507
|
+
aggregation?: {
|
|
2508
|
+
attribute: string;
|
|
2509
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2510
|
+
} | undefined;
|
|
2511
|
+
}, {
|
|
2512
|
+
boundary?: [number, number][] | {
|
|
2513
|
+
type: "Polygon";
|
|
2514
|
+
coordinates: [number, number][][];
|
|
2515
|
+
} | [number, number, number, number] | undefined;
|
|
2516
|
+
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;
|
|
2517
|
+
aggregation?: {
|
|
2518
|
+
attribute: string;
|
|
2519
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2520
|
+
} | undefined;
|
|
2521
|
+
}>>;
|
|
2522
|
+
}, "strip", z.ZodTypeAny, {
|
|
2523
|
+
attribute: string;
|
|
2524
|
+
layerId: string;
|
|
2525
|
+
steps: number[] | {
|
|
2526
|
+
type: "equal-intervals";
|
|
2527
|
+
count: number;
|
|
2528
|
+
} | {
|
|
2529
|
+
type: "time-interval";
|
|
2530
|
+
interval: "hour" | "day" | "week" | "month" | "year";
|
|
2531
|
+
};
|
|
2532
|
+
values?: {
|
|
2533
|
+
boundary?: [number, number][] | {
|
|
2534
|
+
type: "Polygon";
|
|
2535
|
+
coordinates: [number, number][][];
|
|
2536
|
+
} | [number, number, number, number] | undefined;
|
|
2537
|
+
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;
|
|
2538
|
+
aggregation?: {
|
|
2539
|
+
attribute: string;
|
|
2540
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2541
|
+
} | undefined;
|
|
2542
|
+
} | undefined;
|
|
2543
|
+
boundary?: [number, number][] | {
|
|
2544
|
+
type: "Polygon";
|
|
2545
|
+
coordinates: [number, number][][];
|
|
2546
|
+
} | [number, number, number, number] | undefined;
|
|
2547
|
+
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;
|
|
2548
|
+
}, {
|
|
2549
|
+
attribute: string;
|
|
2550
|
+
layerId: string;
|
|
2551
|
+
steps: number[] | {
|
|
2552
|
+
type: "equal-intervals";
|
|
2553
|
+
count: number;
|
|
2554
|
+
} | {
|
|
2555
|
+
type: "time-interval";
|
|
2556
|
+
interval: "hour" | "day" | "week" | "month" | "year";
|
|
2557
|
+
};
|
|
2558
|
+
values?: {
|
|
2559
|
+
boundary?: [number, number][] | {
|
|
2560
|
+
type: "Polygon";
|
|
2561
|
+
coordinates: [number, number][][];
|
|
2562
|
+
} | [number, number, number, number] | undefined;
|
|
2563
|
+
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;
|
|
2564
|
+
aggregation?: {
|
|
2565
|
+
attribute: string;
|
|
2566
|
+
method: "avg" | "max" | "min" | "sum" | "median";
|
|
2567
|
+
} | undefined;
|
|
2568
|
+
} | undefined;
|
|
2569
|
+
boundary?: [number, number][] | {
|
|
2570
|
+
type: "Polygon";
|
|
2571
|
+
coordinates: [number, number][][];
|
|
2572
|
+
} | [number, number, number, number] | undefined;
|
|
2573
|
+
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;
|
|
2574
|
+
}>;
|
|
2575
|
+
/**
|
|
2576
|
+
* The params used to request a histogram of values from a layer, passed to
|
|
2577
|
+
* the {@link LayersController.getHistogramData} method.
|
|
2578
|
+
*/
|
|
2579
|
+
interface GetLayerHistogramParams extends zInfer<typeof GetLayerHistogramParamsSchema> {
|
|
2580
|
+
/**
|
|
2581
|
+
* Attribute filters to determine what gets counted or aggregated.
|
|
2582
|
+
*/
|
|
2583
|
+
filters?: Filters;
|
|
2584
|
+
/**
|
|
2585
|
+
* A spatial boundary to filter what gets counted or aggregated. This can be either
|
|
2586
|
+
* a [w, s, e, n] bounding box, a GeoJSON Polygon geometry, or a list of coordinates
|
|
2587
|
+
* that form a polyline.
|
|
2588
|
+
*/
|
|
2589
|
+
boundary?: PolygonGeometry | LngLatTuple[] | FeltBoundary;
|
|
2590
|
+
}
|
|
2591
|
+
declare const GetLayerHistogramBinSchema: z.ZodObject<{
|
|
2592
|
+
/**
|
|
2593
|
+
* The left edge of the bin.
|
|
2594
|
+
*/
|
|
2595
|
+
min: z.ZodNumber;
|
|
2596
|
+
/**
|
|
2597
|
+
* The right edge of the bin.
|
|
2598
|
+
*/
|
|
2599
|
+
max: z.ZodNumber;
|
|
2600
|
+
/**
|
|
2601
|
+
* The number of features in the bin.
|
|
2602
|
+
*/
|
|
2603
|
+
value: z.ZodNumber;
|
|
2604
|
+
}, "strip", z.ZodTypeAny, {
|
|
2605
|
+
value: number;
|
|
2606
|
+
max: number;
|
|
2607
|
+
min: number;
|
|
2608
|
+
}, {
|
|
2609
|
+
value: number;
|
|
2610
|
+
max: number;
|
|
2611
|
+
min: number;
|
|
2612
|
+
}>;
|
|
2613
|
+
/**
|
|
2614
|
+
* One bin from the response from the {@link LayersController.getHistogramData} method.
|
|
2615
|
+
*/
|
|
2616
|
+
interface GetLayerHistogramBin extends zInfer<typeof GetLayerHistogramBinSchema> {
|
|
2617
|
+
}
|
|
2618
|
+
declare const GetLayerCalculationParamsSchema: z.ZodObject<{
|
|
2619
|
+
/**
|
|
2620
|
+
* The ID of the layer to calculate an aggregate value for.
|
|
2621
|
+
*/
|
|
2622
|
+
layerId: z.ZodString;
|
|
2623
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
2624
|
+
type: z.ZodLiteral<"Polygon">;
|
|
2625
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
|
|
2626
|
+
}, "strip", z.ZodTypeAny, {
|
|
2627
|
+
type: "Polygon";
|
|
2628
|
+
coordinates: [number, number][][];
|
|
2629
|
+
}, {
|
|
2630
|
+
type: "Polygon";
|
|
2631
|
+
coordinates: [number, number][][];
|
|
2632
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2633
|
+
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]>>;
|
|
2634
|
+
aggregation: z.ZodObject<{
|
|
2635
|
+
/**
|
|
2636
|
+
* The operations to use on the values from the features in the layer
|
|
2637
|
+
*/
|
|
2638
|
+
methods: z.ZodArray<z.ZodUnion<[z.ZodEnum<["avg", "max", "min", "sum", "median"]>, z.ZodLiteral<"count">]>, "many">;
|
|
2639
|
+
/**
|
|
2640
|
+
* The attribute to use for the aggregation. This must be a numeric attribute.
|
|
2641
|
+
*/
|
|
2642
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
2643
|
+
}, "strip", z.ZodTypeAny, {
|
|
2644
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2645
|
+
attribute?: string | undefined;
|
|
2646
|
+
}, {
|
|
2647
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2648
|
+
attribute?: string | undefined;
|
|
2649
|
+
}>;
|
|
2650
|
+
}, "strip", z.ZodTypeAny, {
|
|
2651
|
+
layerId: string;
|
|
2652
|
+
aggregation: {
|
|
2653
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2654
|
+
attribute?: string | undefined;
|
|
2655
|
+
};
|
|
2656
|
+
boundary?: [number, number][] | {
|
|
2657
|
+
type: "Polygon";
|
|
2658
|
+
coordinates: [number, number][][];
|
|
2659
|
+
} | [number, number, number, number] | undefined;
|
|
2660
|
+
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;
|
|
2661
|
+
}, {
|
|
2662
|
+
layerId: string;
|
|
2663
|
+
aggregation: {
|
|
2664
|
+
methods: ("avg" | "max" | "min" | "sum" | "median" | "count")[];
|
|
2665
|
+
attribute?: string | undefined;
|
|
2666
|
+
};
|
|
2667
|
+
boundary?: [number, number][] | {
|
|
2668
|
+
type: "Polygon";
|
|
2669
|
+
coordinates: [number, number][][];
|
|
2670
|
+
} | [number, number, number, number] | undefined;
|
|
2671
|
+
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;
|
|
2672
|
+
}>;
|
|
2673
|
+
/**
|
|
2674
|
+
* The parameters for calculating a single aggregate value for a layer, passed to
|
|
2675
|
+
* the {@link LayersController.getAggregates} method.
|
|
2676
|
+
*/
|
|
2677
|
+
interface GetLayerCalculationParams<T extends AggregationMethod | "count"> extends z.infer<typeof GetLayerCalculationParamsSchema> {
|
|
2678
|
+
/**
|
|
2679
|
+
* Attribute filters to determine what gets counted or aggregated.
|
|
2680
|
+
*/
|
|
2681
|
+
filters?: Filters;
|
|
2682
|
+
/**
|
|
2683
|
+
* A spatial boundary to filter what gets counted or aggregated. This can be either
|
|
2684
|
+
* a [w, s, e, n] bounding box, a GeoJSON Polygon geometry, or a list of coordinates
|
|
2685
|
+
* that form a polyline.
|
|
2686
|
+
*/
|
|
2687
|
+
boundary?: PolygonGeometry | LngLatTuple[] | FeltBoundary;
|
|
2688
|
+
/**
|
|
2689
|
+
* Specifies how to aggregate values within each category or bin. When omitted,
|
|
2690
|
+
* features are counted. When specified, the chosen calculation (avg, sum, etc.)
|
|
2691
|
+
* is performed on the specified attribute.
|
|
2692
|
+
*/
|
|
2693
|
+
aggregation: MultiAggregationConfig<T>;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
1948
2696
|
/**
|
|
1949
2697
|
* The event object passed to the interaction listeners.
|
|
1950
2698
|
*/
|
|
@@ -2446,4 +3194,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
2446
3194
|
bounds: [number, number, number, number];
|
|
2447
3195
|
}>;
|
|
2448
3196
|
|
|
2449
|
-
export type {
|
|
3197
|
+
export type { ImageElementRead as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SortConfig as K, Layer as L, MapInteractionEvent as M, SetViewportCenterZoomParams as N, ViewportConstraints as O, ViewportFitBoundsParams as P, ViewportCenterZoom as Q, CircleElementCreate as R, SetVisibilityRequest as S, ToolType as T, CircleElementRead as U, ViewportState as V, CircleElementUpdate as W, HighlighterElementCreate as X, HighlighterElementRead as Y, HighlighterElementUpdate as Z, ImageElementCreate as _, GetElementsConstraint as a, ImageElementUpdate as a0, LinkElementRead as a1, MarkerElementCreate as a2, MarkerElementRead as a3, MarkerElementUpdate as a4, NoteElementCreate as a5, NoteElementRead as a6, NoteElementUpdate as a7, PathElementCreate as a8, PathElementRead as a9, LineStringGeometry as aA, LngLatTuple as aB, MultiLineStringGeometry as aC, MultiPolygonGeometry as aD, PointGeometry as aE, PolygonGeometry as aF, SortDirection as aG, CircleToolSettings as aH, HighlighterToolSettings as aI, LineToolSettings as aJ, MarkerToolSettings as aK, NoteToolSettings as aL, PinToolSettings as aM, PlaceFrame as aN, PlaceSymbol as aO, PolygonToolSettings as aP, RouteToolSettings as aQ, TextToolSettings as aR, UnionToIntersection as aS, PromiseOrNot as aT, PathElementUpdate as aa, PlaceElementCreate as ab, PlaceElementRead as ac, PlaceElementUpdate as ad, PolygonElementCreate as ae, PolygonElementRead as af, PolygonElementUpdate as ag, TextElementCreate as ah, TextElementRead as ai, TextElementUpdate as aj, LayerProcessingStatus as ak, RasterValue as al, FilterExpression as am, FilterLogicGate as an, FilterTernary as ao, AggregationConfig as ap, MultiAggregationConfig as aq, ValueConfiguration as ar, ElementGroupNode as as, ElementNode as at, FeatureNode as au, LayerGroupNode as av, LayerNode as aw, FeltBoundary as ax, FeltZoom as ay, LatLng as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };
|