@deck.gl/carto 8.8.3 → 8.8.6

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.
Files changed (96) hide show
  1. package/dist/dist.dev.js +1382 -1153
  2. package/dist/es5/api/index.js.map +1 -1
  3. package/dist/es5/api/layer-map.js +104 -17
  4. package/dist/es5/api/layer-map.js.map +1 -1
  5. package/dist/es5/api/maps-api-common.js.map +1 -1
  6. package/dist/es5/api/maps-v3-client.js +213 -47
  7. package/dist/es5/api/maps-v3-client.js.map +1 -1
  8. package/dist/es5/api/parseMap.js +14 -4
  9. package/dist/es5/api/parseMap.js.map +1 -1
  10. package/dist/es5/config.js +11 -2
  11. package/dist/es5/config.js.map +1 -1
  12. package/dist/es5/index.js.map +1 -1
  13. package/dist/es5/layers/carto-layer.js +10 -23
  14. package/dist/es5/layers/carto-layer.js.map +1 -1
  15. package/dist/es5/style/color-bins-style.js.map +1 -1
  16. package/dist/es5/style/color-categories-style.js.map +1 -1
  17. package/dist/es5/style/color-continuous-style.js.map +1 -1
  18. package/dist/es5/style/utils.js +3 -1
  19. package/dist/es5/style/utils.js.map +1 -1
  20. package/dist/esm/api/index.js.map +1 -1
  21. package/dist/esm/api/layer-map.js +79 -14
  22. package/dist/esm/api/layer-map.js.map +1 -1
  23. package/dist/esm/api/maps-api-common.js.map +1 -1
  24. package/dist/esm/api/maps-v3-client.js +111 -11
  25. package/dist/esm/api/maps-v3-client.js.map +1 -1
  26. package/dist/esm/api/parseMap.js +18 -4
  27. package/dist/esm/api/parseMap.js.map +1 -1
  28. package/dist/esm/config.js +10 -2
  29. package/dist/esm/config.js.map +1 -1
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/layers/carto-layer.js +7 -19
  32. package/dist/esm/layers/carto-layer.js.map +1 -1
  33. package/dist/esm/style/color-bins-style.js.map +1 -1
  34. package/dist/esm/style/color-categories-style.js.map +1 -1
  35. package/dist/esm/style/color-continuous-style.js.map +1 -1
  36. package/dist/esm/style/utils.js +3 -1
  37. package/dist/esm/style/utils.js.map +1 -1
  38. package/dist.min.js +138 -138
  39. package/package.json +9 -9
  40. package/src/api/index.ts +1 -0
  41. package/src/api/layer-map.ts +76 -13
  42. package/src/api/maps-api-common.ts +8 -0
  43. package/src/api/maps-v3-client.ts +116 -12
  44. package/src/api/parseMap.ts +6 -2
  45. package/src/config.ts +12 -2
  46. package/src/index.ts +1 -1
  47. package/src/layers/carto-layer.ts +19 -32
  48. package/src/style/color-bins-style.ts +25 -3
  49. package/src/style/color-categories-style.ts +28 -4
  50. package/src/style/color-continuous-style.ts +25 -3
  51. package/src/style/utils.ts +8 -4
  52. package/typed/api/index.d.ts +1 -0
  53. package/typed/api/index.d.ts.map +1 -1
  54. package/typed/api/layer-map.d.ts +12 -4
  55. package/typed/api/layer-map.d.ts.map +1 -1
  56. package/typed/api/maps-api-common.d.ts +4 -0
  57. package/typed/api/maps-api-common.d.ts.map +1 -1
  58. package/typed/api/maps-v3-client.d.ts +4 -3
  59. package/typed/api/maps-v3-client.d.ts.map +1 -1
  60. package/typed/config.d.ts +2 -0
  61. package/typed/config.d.ts.map +1 -1
  62. package/typed/index.d.ts +1 -0
  63. package/typed/index.d.ts.map +1 -1
  64. package/typed/layers/carto-layer.d.ts +5 -8
  65. package/typed/layers/carto-layer.d.ts.map +1 -1
  66. package/typed/style/color-bins-style.d.ts +22 -3
  67. package/typed/style/color-bins-style.d.ts.map +1 -1
  68. package/typed/style/color-categories-style.d.ts +24 -4
  69. package/typed/style/color-categories-style.d.ts.map +1 -1
  70. package/typed/style/color-continuous-style.d.ts +22 -3
  71. package/typed/style/color-continuous-style.d.ts.map +1 -1
  72. package/typed/style/utils.d.ts +3 -6
  73. package/typed/style/utils.d.ts.map +1 -1
  74. package/typed/api/index.js +0 -3
  75. package/typed/api/layer-map.js +0 -264
  76. package/typed/api/maps-api-common.js +0 -50
  77. package/typed/api/maps-client.js +0 -125
  78. package/typed/api/maps-v3-client.js +0 -304
  79. package/typed/api/parseMap.js +0 -178
  80. package/typed/basemap.js +0 -9
  81. package/typed/config.js +0 -35
  82. package/typed/index.js +0 -10
  83. package/typed/layers/carto-layer.js +0 -173
  84. package/typed/layers/carto-tile-layer.js +0 -105
  85. package/typed/layers/h3-tile-layer.js +0 -47
  86. package/typed/layers/h3-tileset-2d.js +0 -85
  87. package/typed/layers/quadkey-tile-layer.js +0 -42
  88. package/typed/layers/quadkey-tileset-2d.js +0 -36
  89. package/typed/layers/schema/carto-tile.js +0 -161
  90. package/typed/layers/spatial-index-tile-layer.js +0 -40
  91. package/typed/style/color-bins-style.js +0 -12
  92. package/typed/style/color-categories-style.js +0 -16
  93. package/typed/style/color-continuous-style.js +0 -12
  94. package/typed/style/palette.js +0 -62
  95. package/typed/style/utils.js +0 -15
  96. package/typed/utils.js +0 -4
@@ -1,18 +1,40 @@
1
1
  import {scaleThreshold} from 'd3-scale';
2
+ import {AccessorFunction} from '@deck.gl/core';
3
+ import {Feature} from 'geojson';
2
4
  import getPalette, {Color, DEFAULT_PALETTE, NULL_COLOR} from './palette';
3
5
  import {assert, AttributeSelector, getAttrValue} from './utils';
4
6
 
5
- export default function colorBins({
7
+ /**
8
+ * Helper function for quickly creating a color bins style based on `d3` `scaleThreshold`.
9
+ *
10
+ * Data values of each attribute are rounded down to the nearest value in the domain and are then
11
+ * styled with the corresponding color.
12
+ *
13
+ * @return accessor that maps objects to `Color` values
14
+ */
15
+ export default function colorBins<DataT = Feature>({
6
16
  attr,
7
17
  domain,
8
18
  colors = DEFAULT_PALETTE,
9
19
  nullColor = NULL_COLOR
10
20
  }: {
11
- attr: AttributeSelector;
21
+ /** Attribute or column to symbolize by. */
22
+ attr: AttributeSelector<DataT, number>;
23
+
24
+ /** Category list. Must be a valid list of categories. */
12
25
  domain: number[];
26
+
27
+ /**
28
+ * Color assigned to each domain value.
29
+ *
30
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
31
+ * @default `PurpOr`
32
+ */
13
33
  colors?: string | Color[];
34
+
35
+ /** Color for null values. @default: [204, 204, 204] */
14
36
  nullColor?: Color;
15
- }): AttributeSelector {
37
+ }): AccessorFunction<DataT, Color> {
16
38
  assert(Array.isArray(domain), 'Expected "domain" to be an array of numbers');
17
39
 
18
40
  const palette = typeof colors === 'string' ? getPalette(colors, domain.length + 1) : colors;
@@ -1,19 +1,43 @@
1
+ import {AccessorFunction} from '@deck.gl/core';
2
+ import {Feature} from 'geojson';
1
3
  import getPalette, {Color, DEFAULT_PALETTE, NULL_COLOR, OTHERS_COLOR} from './palette';
2
4
  import {assert, AttributeSelector, getAttrValue} from './utils';
3
5
 
4
- export default function colorCategories({
6
+ /**
7
+ * Helper function for quickly creating a color category style.
8
+ *
9
+ * Data values of each attribute listed in the domain are mapped one to one
10
+ * with corresponding colors in the range.
11
+ *
12
+ * @return accessor that maps objects to `Color` values
13
+ */
14
+ export default function colorCategories<DataT = Feature>({
5
15
  attr,
6
16
  domain,
7
17
  colors = DEFAULT_PALETTE,
8
18
  nullColor = NULL_COLOR,
9
19
  othersColor = OTHERS_COLOR
10
20
  }: {
11
- attr: AttributeSelector;
12
- domain: number[];
21
+ /** Attribute or column to symbolize by */
22
+ attr: string | AttributeSelector<DataT, number | string>;
23
+
24
+ /** Category list. Must be a valid list of categories. */
25
+ domain: number[] | string[];
26
+
27
+ /**
28
+ * Color assigned to each domain value.
29
+ *
30
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
31
+ * @default `PurpOr`
32
+ */
13
33
  colors: string | Color[];
34
+
35
+ /** Color for null values. @default: [204, 204, 204] */
14
36
  nullColor?: Color;
37
+
38
+ /** Fallback color for a category not correctly assigned. @default: [119, 119, 119] */
15
39
  othersColor?: Color;
16
- }): AttributeSelector {
40
+ }): AccessorFunction<DataT, Color> {
17
41
  assert(Array.isArray(domain), 'Expected "domain" to be an array of numbers or strings');
18
42
 
19
43
  const colorsByCategory = {};
@@ -1,18 +1,40 @@
1
+ import {AccessorFunction} from '@deck.gl/core';
1
2
  import {scaleLinear} from 'd3-scale';
3
+ import {Feature} from 'geojson';
2
4
  import getPalette, {Color, DEFAULT_PALETTE, NULL_COLOR} from './palette';
3
5
  import {assert, AttributeSelector, getAttrValue} from './utils';
4
6
 
5
- export default function colorContinuous({
7
+ /**
8
+ * Helper function for quickly creating a color continuous style.
9
+ *
10
+ * Data values of each field are interpolated linearly across values in the domain and
11
+ * are then styled with a blend of the corresponding color in the range.
12
+ *
13
+ * @return accessor that maps objects to `Color` values
14
+ */
15
+ export default function colorContinuous<DataT = Feature>({
6
16
  attr,
7
17
  domain,
8
18
  colors = DEFAULT_PALETTE,
9
19
  nullColor = NULL_COLOR
10
20
  }: {
11
- attr: AttributeSelector;
21
+ /** Attribute or column to symbolize by. */
22
+ attr: AttributeSelector<DataT, number>;
23
+
24
+ /** Attribute domain to define the data range. */
12
25
  domain: number[];
26
+
27
+ /**
28
+ * Color assigned to each domain value.
29
+ *
30
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
31
+ * @default `PurpOr`
32
+ */
13
33
  colors?: string | Color[];
34
+
35
+ /** Color for null values. @default: [204, 204, 204]*/
14
36
  nullColor?: Color;
15
- }): AttributeSelector {
37
+ }): AccessorFunction<DataT, Color> {
16
38
  assert(Array.isArray(domain), 'Expected "domain" to be an array of numbers');
17
39
 
18
40
  const palette = typeof colors === 'string' ? getPalette(colors, domain.length) : colors;
@@ -1,9 +1,13 @@
1
+ import {Feature} from 'geojson';
2
+
1
3
  const ALLOWED_ATTR_TYPES = Object.freeze(['function', 'string']);
2
4
 
3
- type Row = {properties: Record<string, unknown>};
4
- export type AttributeSelector = string | ((d: Row) => unknown);
5
+ export type AttributeSelector<DataT = Feature, OutT = any> = string | ((d: DataT) => OutT);
5
6
 
6
- export function getAttrValue(attr: AttributeSelector, d: Row): unknown {
7
+ export function getAttrValue<DataT = Feature, OutT = any>(
8
+ attr: string | AttributeSelector<DataT, OutT>,
9
+ d: DataT
10
+ ): OutT {
7
11
  assert(typeof d === 'object', 'Expected "data" to be an object');
8
12
  assert(ALLOWED_ATTR_TYPES.includes(typeof attr), 'Expected "attr" to be a function or string');
9
13
 
@@ -11,7 +15,7 @@ export function getAttrValue(attr: AttributeSelector, d: Row): unknown {
11
15
  if (typeof attr === 'function') {
12
16
  return attr(d);
13
17
  }
14
- return d.properties[attr];
18
+ return (d as unknown as Feature)?.properties?.[attr] as OutT;
15
19
  }
16
20
 
17
21
  export function assert(condition, message = ''): asserts condition {
@@ -1,4 +1,5 @@
1
1
  export { FORMATS, TILE_FORMATS, MAP_TYPES, API_VERSIONS } from './maps-api-common';
2
+ export type { QueryParameters } from './maps-api-common';
2
3
  export { getDataV2, CONNECTIONS } from './maps-client';
3
4
  export { fetchLayerData, fetchMap, mapInstantiation } from './maps-v3-client';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACjF,YAAY,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import { scaleLinear, scaleOrdinal, scaleLog, scalePoint, scaleQuantile, scaleQuantize, scaleSqrt, scaleThreshold } from 'd3-scale';
2
2
  import { Layer, _ConstructorOf as ConstructorOf } from '@deck.gl/core/typed';
3
+ import { MVTLayer } from '@deck.gl/geo-layers/typed';
4
+ import CartoTileLayer from '../layers/carto-tile-layer';
5
+ import H3TileLayer from '../layers/h3-tile-layer';
6
+ import QuadbinTileLayer from '../layers/quadbin-tile-layer';
3
7
  declare const SCALE_FUNCS: {
4
8
  linear: typeof scaleLinear;
5
9
  ordinal: typeof scaleOrdinal;
@@ -27,6 +31,7 @@ export declare function getLayer(type: string, config: any, dataset: any): {
27
31
  propMap: any;
28
32
  defaultProps: any;
29
33
  };
34
+ export declare function layerFromTileDataset(formatTiles: string | null | undefined, scheme: string): typeof CartoTileLayer | typeof H3TileLayer | typeof MVTLayer | typeof QuadbinTileLayer;
30
35
  declare function domainFromValues(values: any, scaleType: SCALE_TYPE): any;
31
36
  export declare function opacityToAlpha(opacity: any): number;
32
37
  export declare function getColorValueAccessor({ name }: {
@@ -34,13 +39,16 @@ export declare function getColorValueAccessor({ name }: {
34
39
  }, colorAggregation: any, data: any): any;
35
40
  export declare function getColorAccessor({ name }: {
36
41
  name: any;
37
- }, scaleType: SCALE_TYPE, { colors, colorMap }: {
38
- colors: any;
39
- colorMap: any;
42
+ }, scaleType: SCALE_TYPE, { aggregation, range: { colors, colorMap } }: {
43
+ aggregation: any;
44
+ range: {
45
+ colors: any;
46
+ colorMap: any;
47
+ };
40
48
  }, opacity: number | undefined, data: any): any;
41
49
  export declare function getSizeAccessor({ name }: {
42
50
  name: any;
43
- }, scaleType: SCALE_TYPE, range: Iterable<Range>, data: any): any;
51
+ }, scaleType: SCALE_TYPE, aggregation: any, range: Iterable<Range>, data: any): any;
44
52
  export declare function getTextAccessor({ name, type }: {
45
53
  name: any;
46
54
  type: any;
@@ -1 +1 @@
1
- {"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAA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AAqBD,wBAAgB,qBAAqB,CAAC,EAAC,IAAI,EAAC;;CAAA,EAAE,gBAAgB,KAAA,EAAE,IAAI,EAAE,GAAG,OAIxE;AAED,wBAAgB,gBAAgB,CAC9B,EAAC,IAAI,EAAC;;CAAA,EACN,SAAS,EAAE,UAAU,EACrB,EAAC,WAAW,EAAE,KAAK,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAC;;;;;;CAAA,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,GAAG,OAmCV;AAED,wBAAgB,eAAe,CAC7B,EAAC,IAAI,EAAC;;CAAA,EACN,SAAS,EAAE,UAAU,EACrB,WAAW,KAAA,EACX,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EACtB,IAAI,EAAE,GAAG,OAeV;AAUD,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC;;;CAAA,EAAE,IAAI,KAAA,OAMjD;AAED,wBAAgB,0BAA0B,CAAC,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAC;;;;CAAA,EAAE,MAAM,KAAA,qCAa3E;AAED,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,CAAC"}
@@ -61,5 +61,9 @@ declare type MapInstantiationFormats = Record<Format, {
61
61
  * Simple encode parameter
62
62
  */
63
63
  export declare function encodeParameter(name: string, value: string | boolean | number): string;
64
+ export declare type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;
65
+ export declare type NamedQueryParameter = Record<string, QueryParameterValue>;
66
+ export declare type PositionalQueryParameter = QueryParameterValue[];
67
+ export declare type QueryParameters = NamedQueryParameter | PositionalQueryParameter;
64
68
  export {};
65
69
  //# sourceMappingURL=maps-api-common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"maps-api-common.d.ts","sourceRoot":"","sources":["../../src/api/maps-api-common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,WAAW,CAAC;AACtD,eAAO,MAAM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,uBAAuB;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,aAAK,uBAAuB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAEtF;AAED,oBAAY,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC;AAElG,oBAAY,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEtE,oBAAY,wBAAwB,GAAG,mBAAmB,EAAE,CAAC;AAE7D,oBAAY,eAAe,GAAG,mBAAmB,GAAG,wBAAwB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Maps API Client for Carto 3
3
3
  */
4
4
  import { CloudNativeCredentials } from '../config';
5
- import { Format, MapInstantiation, MapType, SchemaField, TileFormat } from './maps-api-common';
5
+ import { Format, MapInstantiation, MapType, QueryParameters, SchemaField, TileFormat } from './maps-api-common';
6
6
  declare type FetchLayerDataParams = {
7
7
  type: MapType;
8
8
  source: string;
@@ -15,14 +15,15 @@ declare type FetchLayerDataParams = {
15
15
  formatTiles?: TileFormat;
16
16
  aggregationExp?: string;
17
17
  aggregationResLevel?: number;
18
+ queryParameters?: QueryParameters;
18
19
  };
19
- export declare function mapInstantiation({ type, source, connection, credentials, geoColumn, columns, clientId, aggregationExp, aggregationResLevel }: FetchLayerDataParams): Promise<MapInstantiation>;
20
+ export declare function mapInstantiation({ type, source, connection, credentials, geoColumn, columns, clientId, aggregationExp, aggregationResLevel, queryParameters }: FetchLayerDataParams): Promise<MapInstantiation>;
20
21
  export interface FetchLayerDataResult {
21
22
  data: any;
22
23
  format?: Format;
23
24
  schema: SchemaField[];
24
25
  }
25
- export declare function fetchLayerData({ type, source, connection, credentials, geoColumn, columns, format, formatTiles, clientId, aggregationExp, aggregationResLevel }: FetchLayerDataParams): Promise<FetchLayerDataResult>;
26
+ export declare function fetchLayerData({ type, source, connection, credentials, geoColumn, columns, format, formatTiles, clientId, aggregationExp, aggregationResLevel, queryParameters }: FetchLayerDataParams): Promise<FetchLayerDataResult>;
26
27
  export declare function fetchMap({ cartoMapId, clientId, credentials, autoRefresh, onNewData }: {
27
28
  cartoMapId: string;
28
29
  clientId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"maps-v3-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-v3-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAA8C,sBAAsB,EAAC,MAAM,WAAW,CAAC;AAC9F,OAAO,EAIL,MAAM,EAGN,gBAAgB,EAChB,OAAO,EAEP,WAAW,EACX,UAAU,EAEX,MAAM,mBAAmB,CAAC;AA0F3B,aAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,sBAAsB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAmCF,wBAAsB,gBAAgB,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,EACd,mBAAmB,EACp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nB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAgDF,wBAAsB,gBAAgB,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,eAAe,EAChB,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyBlD;AAsDD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AACD,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,eAAe,EAChB,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqBtD;AAsMD,wBAAsB,QAAQ,CAAC,EAC7B,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;4BA8B6B,IAAI;;;;;;;;;GAiCjC"}
package/typed/config.d.ts CHANGED
@@ -22,5 +22,7 @@ export interface CloudNativeCredentials {
22
22
  export declare type Credentials = ClassicCredentials | CloudNativeCredentials;
23
23
  export declare function setDefaultCredentials({ apiVersion, ...rest }: Partial<Credentials>): void;
24
24
  export declare function getDefaultCredentials(): Credentials;
25
+ export declare type V3Endpoint = 'maps' | 'stats';
25
26
  export declare function buildMapsUrlFromBase(apiBaseUrl: string): string;
27
+ export declare function buildStatsUrlFromBase(apiBaseUrl: string): string;
26
28
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;CAEhC,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,WAAW,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAKtE,wBAAgB,qBAAqB,CAAC,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,EAAE,OAAO,CAAC,WAAW,CAAC,QAchF;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAO/D"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;CAEhC,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,WAAW,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAKtE,wBAAgB,qBAAqB,CAAC,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,EAAE,OAAO,CAAC,WAAW,CAAC,QAchF;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,oBAAY,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAW1C,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE"}
package/typed/index.d.ts CHANGED
@@ -9,5 +9,6 @@ export { default as colorBins } from './style/color-bins-style';
9
9
  export { default as colorCategories } from './style/color-categories-style';
10
10
  export { default as colorContinuous } from './style/color-continuous-style';
11
11
  export { FORMATS, TILE_FORMATS, MAP_TYPES, API_VERSIONS, fetchLayerData, fetchMap, getDataV2 as _getDataV2, mapInstantiation as _mapInstantiation } from './api';
12
+ export type { QueryParameters } from './api';
12
13
  export type { CartoLayerProps } from './layers/carto-layer';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAC3D,O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C5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAS,IAAI,UAAU,EACvB,gBAAgB,IAAI,iBAAiB,EACtC,MAAM,OAAO,CAAC;AACf,YAAY,EAAC,eAAe,EAAC,MAAM,OAAO,CAAC;AAC3C,YAAY,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { CompositeLayer, Layer, CompositeLayerProps, LayerProps, ChangeFlags } from '@deck.gl/core/typed';
2
- import { MapType, TileFormat } from '../api/maps-api-common';
1
+ import { CompositeLayer, CompositeLayerProps, Layer, LayerProps, UpdateParameters } from '@deck.gl/core/typed';
2
+ import { MapType, TileFormat, QueryParameters } from '../api/maps-api-common';
3
3
  import { Credentials } from '../config';
4
4
  /** All properties supported by CartoLayer. */
5
5
  export declare type CartoLayerProps<DataT = any> = _CartoLayerProps & CompositeLayerProps<DataT>;
@@ -71,6 +71,8 @@ declare type _CartoLayerProps = {
71
71
  aggregationExp?: string;
72
72
  /** Aggregation resolution level. Only used for spatial index datasets, defaults to 6 for quadbins, 4 for h3. **/
73
73
  aggregationResLevel?: number;
74
+ /** Query parameters to be sent to the server. **/
75
+ queryParameters?: QueryParameters;
74
76
  };
75
77
  export default class CartoLayer<ExtraProps = {}> extends CompositeLayer<Required<_CartoLayerProps> & ExtraProps> {
76
78
  static layerName: string;
@@ -78,12 +80,7 @@ export default class CartoLayer<ExtraProps = {}> extends CompositeLayer<Required
78
80
  initializeState(): void;
79
81
  get isLoaded(): boolean;
80
82
  _checkProps(props: CartoLayerProps): void;
81
- updateState({ props, oldProps, changeFlags }: {
82
- props: CartoLayerProps;
83
- oldProps: CartoLayerProps;
84
- context: any;
85
- changeFlags: ChangeFlags;
86
- }): void;
83
+ updateState({ props, oldProps, changeFlags }: UpdateParameters<this>): void;
87
84
  _updateData(): Promise<void>;
88
85
  _getSubLayerAndProps(): [any, LayerProps];
89
86
  renderLayers(): Layer | null;
@@ -1 +1 @@
1
- {"version":3,"file":"carto-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,EAEL,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,eAAe,CAAC;AAMvB,OAAO,EAIL,OAAO,EAEP,UAAU,EAEX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,WAAW,EAEZ,MAAM,WAAW,CAAC;AA4CnB,8CAA8C;AAC9C,oBAAY,eAAe,CAAC,KAAK,GAAG,GAAG,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAEzF,sCAAsC;AACtC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;OAOG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,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UAAU,CAAC;IAuBzC,YAAY,IAAI,KAAK,GAAG,IAAI;CAqB7B"}
@@ -1,9 +1,28 @@
1
+ import { AccessorFunction } from '@deck.gl/core/typed';
2
+ import { Feature } from 'geojson';
1
3
  import { Color } from './palette';
2
4
  import { AttributeSelector } from './utils';
3
- export default function colorBins({ attr, domain, colors, nullColor }: {
4
- attr: AttributeSelector;
5
+ /**
6
+ * Helper function for quickly creating a color bins style based on `d3` `scaleThreshold`.
7
+ *
8
+ * Data values of each attribute are rounded down to the nearest value in the domain and are then
9
+ * styled with the corresponding color.
10
+ *
11
+ * @return accessor that maps objects to `Color` values
12
+ */
13
+ export default function colorBins<DataT = Feature>({ attr, domain, colors, nullColor }: {
14
+ /** Attribute or column to symbolize by. */
15
+ attr: AttributeSelector<DataT, number>;
16
+ /** Category list. Must be a valid list of categories. */
5
17
  domain: number[];
18
+ /**
19
+ * Color assigned to each domain value.
20
+ *
21
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
22
+ * @default `PurpOr`
23
+ */
6
24
  colors?: string | Color[];
25
+ /** Color for null values. @default: [204, 204, 204] */
7
26
  nullColor?: Color;
8
- }): AttributeSelector;
27
+ }): AccessorFunction<DataT, Color>;
9
28
  //# sourceMappingURL=color-bins-style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,iBAAiB,CAWpB"}
1
+ {"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAWjC"}
@@ -1,10 +1,30 @@
1
+ import { AccessorFunction } from '@deck.gl/core/typed';
2
+ import { Feature } from 'geojson';
1
3
  import { Color } from './palette';
2
4
  import { AttributeSelector } from './utils';
3
- export default function colorCategories({ attr, domain, colors, nullColor, othersColor }: {
4
- attr: AttributeSelector;
5
- domain: number[];
5
+ /**
6
+ * Helper function for quickly creating a color category style.
7
+ *
8
+ * Data values of each attribute listed in the domain are mapped one to one
9
+ * with corresponding colors in the range.
10
+ *
11
+ * @return accessor that maps objects to `Color` values
12
+ */
13
+ export default function colorCategories<DataT = Feature>({ attr, domain, colors, nullColor, othersColor }: {
14
+ /** Attribute or column to symbolize by */
15
+ attr: string | AttributeSelector<DataT, number | string>;
16
+ /** Category list. Must be a valid list of categories. */
17
+ domain: number[] | string[];
18
+ /**
19
+ * Color assigned to each domain value.
20
+ *
21
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
22
+ * @default `PurpOr`
23
+ */
6
24
  colors: string | Color[];
25
+ /** Color for null values. @default: [204, 204, 204] */
7
26
  nullColor?: Color;
27
+ /** Fallback color for a category not correctly assigned. @default: [119, 119, 119] */
8
28
  othersColor?: Color;
9
- }): AttributeSelector;
29
+ }): AccessorFunction<DataT, Color>;
10
30
  //# sourceMappingURL=color-categories-style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,iBAAiB,CAgBpB"}
1
+ {"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,0CAA0C;IAC1C,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAEzD,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAgBjC"}
@@ -1,9 +1,28 @@
1
+ import { AccessorFunction } from '@deck.gl/core/typed';
2
+ import { Feature } from 'geojson';
1
3
  import { Color } from './palette';
2
4
  import { AttributeSelector } from './utils';
3
- export default function colorContinuous({ attr, domain, colors, nullColor }: {
4
- attr: AttributeSelector;
5
+ /**
6
+ * Helper function for quickly creating a color continuous style.
7
+ *
8
+ * Data values of each field are interpolated linearly across values in the domain and
9
+ * are then styled with a blend of the corresponding color in the range.
10
+ *
11
+ * @return accessor that maps objects to `Color` values
12
+ */
13
+ export default function colorContinuous<DataT = Feature>({ attr, domain, colors, nullColor }: {
14
+ /** Attribute or column to symbolize by. */
15
+ attr: AttributeSelector<DataT, number>;
16
+ /** Attribute domain to define the data range. */
5
17
  domain: number[];
18
+ /**
19
+ * Color assigned to each domain value.
20
+ *
21
+ * Either Array of colors in RGBA or valid named CARTOColors palette.
22
+ * @default `PurpOr`
23
+ */
6
24
  colors?: string | Color[];
25
+ /** Color for null values. @default: [204, 204, 204]*/
7
26
  nullColor?: Color;
8
- }): AttributeSelector;
27
+ }): AccessorFunction<DataT, Color>;
9
28
  //# sourceMappingURL=color-continuous-style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AACA,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,iBAAiB,CAUpB"}
1
+ {"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUjC"}
@@ -1,8 +1,5 @@
1
- declare type Row = {
2
- properties: Record<string, unknown>;
3
- };
4
- export declare type AttributeSelector = string | ((d: Row) => unknown);
5
- export declare function getAttrValue(attr: AttributeSelector, d: Row): unknown;
1
+ import { Feature } from 'geojson';
2
+ export declare type AttributeSelector<DataT = Feature, OutT = any> = string | ((d: DataT) => OutT);
3
+ export declare function getAttrValue<DataT = Feature, OutT = any>(attr: string | AttributeSelector<DataT, OutT>, d: DataT): OutT;
6
4
  export declare function assert(condition: any, message?: string): asserts condition;
7
- export {};
8
5
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAEA,aAAK,GAAG,GAAG;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAC,CAAC;AACjD,oBAAY,iBAAiB,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC;AAE/D,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CASrE;AAED,wBAAgB,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,SAAS,CAIjE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAIhC,oBAAY,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAE3F,wBAAgB,YAAY,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAC7C,CAAC,EAAE,KAAK,GACP,IAAI,CASN;AAED,wBAAgB,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,SAAS,CAIjE"}
@@ -1,3 +0,0 @@
1
- export { FORMATS, TILE_FORMATS, MAP_TYPES, API_VERSIONS } from './maps-api-common';
2
- export { getDataV2, CONNECTIONS } from './maps-client';
3
- export { fetchLayerData, fetchMap, getData, mapInstantiation } from './maps-v3-client';