@carto/api-client 0.5.30 → 0.5.31

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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "homepage": "https://github.com/CartoDB/carto-api-client#readme",
9
9
  "author": "Don McCurdy <donmccurdy@carto.com>",
10
10
  "packageManager": "yarn@4.3.1",
11
- "version": "0.5.30",
11
+ "version": "0.5.31",
12
12
  "license": "MIT",
13
13
  "publishConfig": {
14
14
  "access": "public"
@@ -320,7 +320,7 @@ export async function fetchMap({
320
320
  datasetsWithLabels.has(dataset.id) &&
321
321
  (dataset.type === 'table' || dataset.type === 'query')
322
322
  ) {
323
- dataset.featureBbox = true;
323
+ dataset.prepareLabels = true;
324
324
  }
325
325
  });
326
326
 
@@ -106,13 +106,13 @@ export function configureSource({
106
106
  tileResolution,
107
107
  ...(queryParameters && {queryParameters}),
108
108
  } as QuerySourceOptions;
109
- const {featureBbox} = dataset;
109
+ const {prepareLabels} = dataset;
110
110
  const vectorOptions = {
111
111
  spatialDataColumn,
112
112
  ...(columns && {columns}),
113
113
  ...(filters && {filters}),
114
114
  ...(aggregationExp && {aggregationExp}),
115
- ...(featureBbox && {featureBbox}),
115
+ ...(prepareLabels && {prepareLabels}),
116
116
  } as VectorTableSourceOptions;
117
117
 
118
118
  if (type === 'raster') {
@@ -265,7 +265,7 @@ export type Dataset = {
265
265
  name?: string | null;
266
266
  spatialIndex?: string | null;
267
267
  exportToBucketAvailable?: boolean;
268
- featureBbox?: boolean;
268
+ prepareLabels?: boolean;
269
269
  };
270
270
 
271
271
  export type AttributeType = 'String' | 'Number' | 'Timestamp' | 'Boolean';
package/src/geo.ts CHANGED
@@ -4,10 +4,10 @@ import union from '@turf/union';
4
4
  import {getType} from '@turf/invariant';
5
5
  import {polygon, multiPolygon, feature, featureCollection} from '@turf/helpers';
6
6
  import type {BBox, Geometry, MultiPolygon, Polygon, Position} from 'geojson';
7
- import type {SpatialFilter} from './types.js';
7
+ import type {GeometrySpatialFilter} from './types.js';
8
8
 
9
9
  /**
10
- * Returns a {@link SpatialFilter} for a given viewport, typically obtained
10
+ * Returns a {@link GeometrySpatialFilter} for a given viewport, typically obtained
11
11
  * from deck.gl's `viewport.getBounds()` method ([west, south, east, north]).
12
12
  * If the viewport covers the entire world (to some margin of error in Web
13
13
  * Mercator space), `undefined` is returned instead.
@@ -17,7 +17,7 @@ import type {SpatialFilter} from './types.js';
17
17
  */
18
18
  export function createViewportSpatialFilter(
19
19
  viewport: BBox
20
- ): SpatialFilter | undefined {
20
+ ): GeometrySpatialFilter | undefined {
21
21
  if (_isGlobalViewport(viewport)) {
22
22
  return;
23
23
  }
@@ -25,14 +25,14 @@ export function createViewportSpatialFilter(
25
25
  }
26
26
 
27
27
  /**
28
- * Returns a {@link SpatialFilter} for a given {@link Polygon} or
28
+ * Returns a {@link GeometrySpatialFilter} for a given {@link Polygon} or
29
29
  * {@link MultiPolygon}. If the polygon(s) extend outside longitude
30
30
  * range [-180, +180], the result may be reformatted for compatibility
31
31
  * with CARTO APIs.
32
32
  */
33
33
  export function createPolygonSpatialFilter(
34
34
  spatialFilter: Polygon | MultiPolygon
35
- ): SpatialFilter | undefined {
35
+ ): GeometrySpatialFilter | undefined {
36
36
  return (spatialFilter && _normalizeGeometry(spatialFilter)) || undefined;
37
37
  }
38
38
 
@@ -30,7 +30,7 @@ export type VectorQuerySourceOptions = SourceOptions &
30
30
  * a `"west,south,east,north"` string in WGS84. Used by clients to compute
31
31
  * stable label positions for polygons that span multiple tiles.
32
32
  */
33
- featureBbox?: boolean;
33
+ prepareLabels?: boolean;
34
34
  };
35
35
 
36
36
  type UrlParameters = {
@@ -59,7 +59,7 @@ export const vectorQuerySource = async function (
59
59
  tileResolution = DEFAULT_TILE_RESOLUTION,
60
60
  queryParameters,
61
61
  aggregationExp,
62
- featureBbox,
62
+ prepareLabels,
63
63
  } = options;
64
64
 
65
65
  const spatialDataType = 'geo';
@@ -83,7 +83,7 @@ export const vectorQuerySource = async function (
83
83
  if (aggregationExp) {
84
84
  urlParameters.aggregationExp = aggregationExp;
85
85
  }
86
- if (featureBbox) {
86
+ if (prepareLabels) {
87
87
  urlParameters.featureBbox = true;
88
88
  }
89
89
 
@@ -30,7 +30,7 @@ export type VectorTableSourceOptions = SourceOptions &
30
30
  * a `"west,south,east,north"` string in WGS84. Used by clients to compute
31
31
  * stable label positions for polygons that span multiple tiles.
32
32
  */
33
- featureBbox?: boolean;
33
+ prepareLabels?: boolean;
34
34
  };
35
35
 
36
36
  type UrlParameters = {
@@ -57,7 +57,7 @@ export const vectorTableSource = async function (
57
57
  tableName,
58
58
  tileResolution = DEFAULT_TILE_RESOLUTION,
59
59
  aggregationExp,
60
- featureBbox,
60
+ prepareLabels,
61
61
  } = options;
62
62
 
63
63
  const spatialDataType = 'geo';
@@ -78,7 +78,7 @@ export const vectorTableSource = async function (
78
78
  if (aggregationExp) {
79
79
  urlParameters.aggregationExp = aggregationExp;
80
80
  }
81
- if (featureBbox) {
81
+ if (prepareLabels) {
82
82
  urlParameters.featureBbox = true;
83
83
  }
84
84