@carto/api-client 0.5.1-alpha.2 → 0.5.1
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/CHANGELOG.md +7 -2
- package/build/api-client.cjs +22 -29
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +38 -15
- package/build/api-client.d.ts +38 -15
- package/build/api-client.js +18 -29
- package/build/api-client.js.map +1 -1
- package/build/worker.js +3 -0
- package/build/worker.js.map +1 -1
- package/package.json +3 -4
- package/src/fetch-map/fetch-map.ts +1 -7
- package/src/fetch-map/parse-map.ts +2 -1
- package/src/fetch-map/source.ts +12 -3
- package/src/fetch-map/types.ts +3 -2
- package/src/index.ts +1 -0
- package/src/sources/base-source.ts +8 -22
- package/src/sources/boundary-query-source.ts +1 -5
- package/src/sources/boundary-table-source.ts +1 -5
- package/src/sources/h3-query-source.ts +1 -1
- package/src/sources/h3-table-source.ts +1 -1
- package/src/sources/h3-tileset-source.ts +2 -2
- package/src/sources/index.ts +18 -10
- package/src/sources/quadbin-query-source.ts +1 -1
- package/src/sources/quadbin-table-source.ts +1 -1
- package/src/sources/quadbin-tileset-source.ts +2 -2
- package/src/sources/raster-source.ts +3 -3
- package/src/sources/types.ts +6 -8
- package/src/sources/vector-query-source.ts +1 -1
- package/src/sources/vector-table-source.ts +1 -1
- package/src/sources/vector-tileset-source.ts +2 -2
- package/src/types-internal.ts +0 -24
- package/src/widget-sources/types.ts +2 -2
- package/src/widget-sources/widget-tileset-source-impl.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
## 0.5
|
|
3
|
+
## 0.5
|
|
4
4
|
|
|
5
|
-
### 0.5.
|
|
5
|
+
### 0.5.1
|
|
6
|
+
|
|
7
|
+
- chore(types): Cleanup for tilesets, rasters, and backward-compatibility (#150)
|
|
8
|
+
- feat(fetchMap): Export legendSettings (#153)
|
|
9
|
+
|
|
10
|
+
### 0.5.0
|
|
6
11
|
|
|
7
12
|
- BREAKING CHANGE: Replace 'abortController' with 'signal' parameter (#110)
|
|
8
13
|
- feat: Add widget calculations for tileset sources (#50)
|
package/build/api-client.cjs
CHANGED
|
@@ -5531,6 +5531,7 @@ __export(src_exports, {
|
|
|
5531
5531
|
buildPublicMapUrl: () => buildPublicMapUrl,
|
|
5532
5532
|
buildStatsUrl: () => buildStatsUrl,
|
|
5533
5533
|
clearFilters: () => clearFilters,
|
|
5534
|
+
configureSource: () => configureSource,
|
|
5534
5535
|
createPolygonSpatialFilter: () => createPolygonSpatialFilter,
|
|
5535
5536
|
createViewportSpatialFilter: () => createViewportSpatialFilter,
|
|
5536
5537
|
fetchBasemapProps: () => fetchBasemapProps,
|
|
@@ -5540,12 +5541,14 @@ __export(src_exports, {
|
|
|
5540
5541
|
getClient: () => getClient,
|
|
5541
5542
|
getColorAccessor: () => getColorAccessor,
|
|
5542
5543
|
getColorValueAccessor: () => getColorValueAccessor,
|
|
5544
|
+
getColumnNameFromGeoColumn: () => getColumnNameFromGeoColumn,
|
|
5543
5545
|
getDataFilterExtensionProps: () => getDataFilterExtensionProps,
|
|
5544
5546
|
getFilter: () => getFilter,
|
|
5545
5547
|
getIconUrlAccessor: () => getIconUrlAccessor,
|
|
5546
5548
|
getLayerProps: () => getLayerProps,
|
|
5547
5549
|
getMaxMarkerSize: () => getMaxMarkerSize,
|
|
5548
5550
|
getSizeAccessor: () => getSizeAccessor,
|
|
5551
|
+
getSpatialIndexFromGeoColumn: () => getSpatialIndexFromGeoColumn,
|
|
5549
5552
|
getTextAccessor: () => getTextAccessor,
|
|
5550
5553
|
groupValuesByColumn: () => groupValuesByColumn,
|
|
5551
5554
|
groupValuesByDateColumn: () => groupValuesByDateColumn,
|
|
@@ -5565,6 +5568,7 @@ __export(src_exports, {
|
|
|
5565
5568
|
rasterSource: () => rasterSource,
|
|
5566
5569
|
removeFilter: () => removeFilter,
|
|
5567
5570
|
requestWithParameters: () => requestWithParameters,
|
|
5571
|
+
scaleAggregationResLevel: () => scaleAggregationResLevel,
|
|
5568
5572
|
scatterPlot: () => scatterPlot,
|
|
5569
5573
|
setClient: () => setClient,
|
|
5570
5574
|
tileFeatures: () => tileFeatures,
|
|
@@ -11501,7 +11505,6 @@ function excludeURLParameters(baseUrlString, parameters) {
|
|
|
11501
11505
|
// src/sources/base-source.ts
|
|
11502
11506
|
var SOURCE_DEFAULTS = {
|
|
11503
11507
|
apiBaseUrl: DEFAULT_API_BASE_URL,
|
|
11504
|
-
format: "tilejson",
|
|
11505
11508
|
headers: {},
|
|
11506
11509
|
maxLengthURL: DEFAULT_MAX_LENGTH_URL
|
|
11507
11510
|
};
|
|
@@ -11520,7 +11523,7 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
11520
11523
|
}
|
|
11521
11524
|
}
|
|
11522
11525
|
const baseUrl = buildSourceUrl(mergedOptions);
|
|
11523
|
-
const { clientId, maxLengthURL,
|
|
11526
|
+
const { clientId, maxLengthURL, localCache } = mergedOptions;
|
|
11524
11527
|
const headers = {
|
|
11525
11528
|
Authorization: `Bearer ${options.accessToken}`,
|
|
11526
11529
|
...options.headers
|
|
@@ -11540,7 +11543,7 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
11540
11543
|
maxLengthURL,
|
|
11541
11544
|
localCache
|
|
11542
11545
|
});
|
|
11543
|
-
const dataUrl = mapInstantiation
|
|
11546
|
+
const dataUrl = mapInstantiation.tilejson.url[0];
|
|
11544
11547
|
if (cache) {
|
|
11545
11548
|
cache.value = parseInt(
|
|
11546
11549
|
new URL(dataUrl).searchParams.get("cache") || "",
|
|
@@ -11548,21 +11551,7 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
11548
11551
|
);
|
|
11549
11552
|
}
|
|
11550
11553
|
errorContext.requestType = "Map data";
|
|
11551
|
-
|
|
11552
|
-
const json = await requestWithParameters({
|
|
11553
|
-
baseUrl: dataUrl,
|
|
11554
|
-
parameters: { client: clientId },
|
|
11555
|
-
headers,
|
|
11556
|
-
errorContext,
|
|
11557
|
-
maxLengthURL,
|
|
11558
|
-
localCache
|
|
11559
|
-
});
|
|
11560
|
-
if (accessToken) {
|
|
11561
|
-
json.accessToken = accessToken;
|
|
11562
|
-
}
|
|
11563
|
-
return json;
|
|
11564
|
-
}
|
|
11565
|
-
return await requestWithParameters({
|
|
11554
|
+
const json = await requestWithParameters({
|
|
11566
11555
|
baseUrl: dataUrl,
|
|
11567
11556
|
parameters: { client: clientId },
|
|
11568
11557
|
headers,
|
|
@@ -11570,6 +11559,10 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
11570
11559
|
maxLengthURL,
|
|
11571
11560
|
localCache
|
|
11572
11561
|
});
|
|
11562
|
+
if (accessToken) {
|
|
11563
|
+
json.accessToken = accessToken;
|
|
11564
|
+
}
|
|
11565
|
+
return json;
|
|
11573
11566
|
}
|
|
11574
11567
|
|
|
11575
11568
|
// src/sources/boundary-query-source.ts
|
|
@@ -11595,11 +11588,7 @@ var boundaryQuerySource = async function(options) {
|
|
|
11595
11588
|
if (queryParameters) {
|
|
11596
11589
|
urlParameters.queryParameters = queryParameters;
|
|
11597
11590
|
}
|
|
11598
|
-
return baseSource(
|
|
11599
|
-
"boundary",
|
|
11600
|
-
options,
|
|
11601
|
-
urlParameters
|
|
11602
|
-
);
|
|
11591
|
+
return baseSource("boundary", options, urlParameters);
|
|
11603
11592
|
};
|
|
11604
11593
|
|
|
11605
11594
|
// src/sources/boundary-table-source.ts
|
|
@@ -11616,11 +11605,7 @@ var boundaryTableSource = async function(options) {
|
|
|
11616
11605
|
if (filters) {
|
|
11617
11606
|
urlParameters.filters = filters;
|
|
11618
11607
|
}
|
|
11619
|
-
return baseSource(
|
|
11620
|
-
"boundary",
|
|
11621
|
-
options,
|
|
11622
|
-
urlParameters
|
|
11623
|
-
);
|
|
11608
|
+
return baseSource("boundary", options, urlParameters);
|
|
11624
11609
|
};
|
|
11625
11610
|
|
|
11626
11611
|
// src/sources/h3-query-source.ts
|
|
@@ -12909,6 +12894,9 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
12909
12894
|
return { rows: [], totalCount: 0 };
|
|
12910
12895
|
}
|
|
12911
12896
|
if (searchFilterColumn && searchFilterText) {
|
|
12897
|
+
console.warn(
|
|
12898
|
+
'WidgetTilesetSource: "searchFilterText" is deprecated, use "filters" and FilterType.STRING_SEARCH instead.'
|
|
12899
|
+
);
|
|
12912
12900
|
filteredFeatures = filteredFeatures.filter(
|
|
12913
12901
|
(row) => row[searchFilterColumn] && String(row[searchFilterColumn]).toLowerCase().includes(String(searchFilterText).toLowerCase())
|
|
12914
12902
|
);
|
|
@@ -14756,7 +14744,7 @@ function parseMap(json) {
|
|
|
14756
14744
|
const { keplerMapConfig, datasets, token } = json;
|
|
14757
14745
|
assert2(keplerMapConfig.version === "v1", "Only support Kepler v1");
|
|
14758
14746
|
const config2 = keplerMapConfig.config;
|
|
14759
|
-
const { filters, mapState, mapStyle, popupSettings } = config2;
|
|
14747
|
+
const { filters, mapState, mapStyle, popupSettings, legendSettings } = config2;
|
|
14760
14748
|
const { layers, layerBlending, interactionConfig } = config2.visState;
|
|
14761
14749
|
return {
|
|
14762
14750
|
id: json.id,
|
|
@@ -14768,6 +14756,7 @@ function parseMap(json) {
|
|
|
14768
14756
|
/** @deprecated Use `basemap`. */
|
|
14769
14757
|
mapStyle,
|
|
14770
14758
|
popupSettings,
|
|
14759
|
+
legendSettings,
|
|
14771
14760
|
token,
|
|
14772
14761
|
layers: layers.reverse().map(({ id, type, config: config3, visualChannels }) => {
|
|
14773
14762
|
try {
|
|
@@ -15722,6 +15711,7 @@ function _getHexagonResolution(viewport, tileSize) {
|
|
|
15722
15711
|
buildPublicMapUrl,
|
|
15723
15712
|
buildStatsUrl,
|
|
15724
15713
|
clearFilters,
|
|
15714
|
+
configureSource,
|
|
15725
15715
|
createPolygonSpatialFilter,
|
|
15726
15716
|
createViewportSpatialFilter,
|
|
15727
15717
|
fetchBasemapProps,
|
|
@@ -15731,12 +15721,14 @@ function _getHexagonResolution(viewport, tileSize) {
|
|
|
15731
15721
|
getClient,
|
|
15732
15722
|
getColorAccessor,
|
|
15733
15723
|
getColorValueAccessor,
|
|
15724
|
+
getColumnNameFromGeoColumn,
|
|
15734
15725
|
getDataFilterExtensionProps,
|
|
15735
15726
|
getFilter,
|
|
15736
15727
|
getIconUrlAccessor,
|
|
15737
15728
|
getLayerProps,
|
|
15738
15729
|
getMaxMarkerSize,
|
|
15739
15730
|
getSizeAccessor,
|
|
15731
|
+
getSpatialIndexFromGeoColumn,
|
|
15740
15732
|
getTextAccessor,
|
|
15741
15733
|
groupValuesByColumn,
|
|
15742
15734
|
groupValuesByDateColumn,
|
|
@@ -15756,6 +15748,7 @@ function _getHexagonResolution(viewport, tileSize) {
|
|
|
15756
15748
|
rasterSource,
|
|
15757
15749
|
removeFilter,
|
|
15758
15750
|
requestWithParameters,
|
|
15751
|
+
scaleAggregationResLevel,
|
|
15759
15752
|
scatterPlot,
|
|
15760
15753
|
setClient,
|
|
15761
15754
|
tileFeatures,
|