@carto/api-client 0.5.0-alpha.13 → 0.5.0-alpha.15
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 +30 -1
- package/build/api-client.cjs +9849 -2868
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +510 -171
- package/build/api-client.d.ts +510 -171
- package/build/api-client.js +9558 -2627
- package/build/api-client.js.map +1 -1
- package/build/worker.js +122 -469
- package/build/worker.js.map +1 -1
- package/package.json +36 -22
- package/src/api/query.ts +2 -1
- package/src/constants-internal.ts +10 -0
- package/src/constants.ts +5 -1
- package/src/fetch-map/basemap-styles.ts +159 -0
- package/src/fetch-map/basemap.ts +120 -0
- package/src/fetch-map/fetch-map.ts +331 -0
- package/src/fetch-map/index.ts +13 -0
- package/src/fetch-map/layer-map.ts +461 -0
- package/src/fetch-map/parse-map.ts +425 -0
- package/src/fetch-map/source.ts +233 -0
- package/src/fetch-map/types.ts +268 -0
- package/src/fetch-map/utils.ts +69 -0
- package/src/filters/tileFeatures.ts +26 -10
- package/src/filters/tileFeaturesRaster.ts +122 -0
- package/src/index.ts +1 -0
- package/src/models/model.ts +0 -7
- package/src/sources/base-source.ts +4 -2
- package/src/sources/h3-tileset-source.ts +1 -1
- package/src/sources/quadbin-tileset-source.ts +1 -1
- package/src/sources/raster-source.ts +18 -5
- package/src/sources/types.ts +14 -7
- package/src/sources/vector-tileset-source.ts +1 -1
- package/src/spatial-index.ts +3 -84
- package/src/types.ts +16 -2
- package/src/widget-sources/index.ts +1 -0
- package/src/widget-sources/types.ts +0 -2
- package/src/widget-sources/widget-raster-source.ts +14 -0
- package/src/widget-sources/widget-remote-source.ts +8 -76
- package/src/widget-sources/widget-source.ts +6 -24
- package/src/widget-sources/widget-tileset-source-impl.ts +13 -16
- package/src/widget-sources/widget-tileset-source.ts +20 -7
package/build/api-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Polygon, MultiPolygon,
|
|
1
|
+
import { Feature, Polygon, MultiPolygon, BBox, FeatureCollection, Geometry } from 'geojson';
|
|
2
2
|
import { BinaryFeatureCollection, BinaryFeature } from '@loaders.gl/schema';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -57,7 +57,6 @@ declare enum TileFormat {
|
|
|
57
57
|
/** @privateRemarks Source: @carto/react-core */
|
|
58
58
|
declare enum SpatialIndex {
|
|
59
59
|
H3 = "h3",
|
|
60
|
-
S2 = "s2",
|
|
61
60
|
QUADBIN = "quadbin"
|
|
62
61
|
}
|
|
63
62
|
/** @privateRemarks Source: @carto/react-core */
|
|
@@ -69,6 +68,10 @@ declare enum Provider {
|
|
|
69
68
|
DATABRICKS = "databricks",
|
|
70
69
|
DATABRICKS_REST = "databricksRest"
|
|
71
70
|
}
|
|
71
|
+
declare const SpatialIndexColumn: Readonly<{
|
|
72
|
+
h3: string[];
|
|
73
|
+
quadbin: string[];
|
|
74
|
+
}>;
|
|
72
75
|
|
|
73
76
|
/******************************************************************************
|
|
74
77
|
* MAPS AND TILES
|
|
@@ -77,6 +80,8 @@ declare enum Provider {
|
|
|
77
80
|
type Format = 'json' | 'geojson' | 'tilejson';
|
|
78
81
|
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
79
82
|
type MapType = 'boundary' | 'query' | 'table' | 'tileset' | 'raster';
|
|
83
|
+
/** @privateRemarks Source: cloud-native */
|
|
84
|
+
type ProviderType = 'bigquery' | 'postgres' | 'snowflake' | 'redshift' | 'databricks' | 'carto' | 'carto_dw';
|
|
80
85
|
/**
|
|
81
86
|
* Alias for GeoJSON 'BBox' type, semantically representing a viewport.
|
|
82
87
|
* Order of values is "west", "south", "east", "north".
|
|
@@ -96,8 +101,6 @@ type Tile = {
|
|
|
96
101
|
z: number;
|
|
97
102
|
};
|
|
98
103
|
id: string;
|
|
99
|
-
content: unknown;
|
|
100
|
-
zoom: number;
|
|
101
104
|
bbox: {
|
|
102
105
|
west: number;
|
|
103
106
|
east: number;
|
|
@@ -113,6 +116,14 @@ type SpatialIndexTile = Tile & {
|
|
|
113
116
|
id: bigint;
|
|
114
117
|
})[];
|
|
115
118
|
};
|
|
119
|
+
type RasterTile = Tile & {
|
|
120
|
+
id: string;
|
|
121
|
+
index: {
|
|
122
|
+
q: bigint;
|
|
123
|
+
i: string;
|
|
124
|
+
};
|
|
125
|
+
data?: Raster;
|
|
126
|
+
};
|
|
116
127
|
/** @privateRemarks Source: @deck.gl/carto */
|
|
117
128
|
type Raster = {
|
|
118
129
|
blockSize: number;
|
|
@@ -243,60 +254,45 @@ type _DataFilterExtensionProps = {
|
|
|
243
254
|
*/
|
|
244
255
|
declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
|
|
245
256
|
|
|
246
|
-
type
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
* `column` and `type` will be replaced.
|
|
254
|
-
*/
|
|
255
|
-
declare function addFilter(filters: Record<string, Filter>, { column, type, values, owner }: AddFilterOptions): Record<string, Filter>;
|
|
256
|
-
type RemoveFilterOptions = {
|
|
257
|
-
column: string;
|
|
258
|
-
owner?: string;
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* Removes one or more {@link Filter filters} from the filter set. If only
|
|
262
|
-
* `column` is specified, then all filters on that column are removed. If both
|
|
263
|
-
* `column` and `owner` are specified, then only filters for that column
|
|
264
|
-
* associated with the owner are removed.
|
|
265
|
-
*/
|
|
266
|
-
declare function removeFilter(filters: Record<string, Filter>, { column, owner }: RemoveFilterOptions): Record<string, Filter>;
|
|
267
|
-
/**
|
|
268
|
-
* Clears all {@link Filter filters} from the filter set.
|
|
269
|
-
*/
|
|
270
|
-
declare function clearFilters(filters: Record<string, Filter>): Record<string, Filter>;
|
|
271
|
-
type HasFilterOptions = {
|
|
272
|
-
column: string;
|
|
273
|
-
owner?: string;
|
|
274
|
-
};
|
|
275
|
-
declare function hasFilter(filters: Record<string, Filter>, { column, owner }: HasFilterOptions): boolean;
|
|
276
|
-
type GetFilterOptions<T extends FilterType> = {
|
|
277
|
-
column: string;
|
|
278
|
-
type: T;
|
|
279
|
-
owner?: string;
|
|
257
|
+
type APIRequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL' | 'Basemap style';
|
|
258
|
+
type APIErrorContext = {
|
|
259
|
+
requestType: APIRequestType;
|
|
260
|
+
mapId?: string;
|
|
261
|
+
connection?: string;
|
|
262
|
+
source?: string;
|
|
263
|
+
type?: MapType;
|
|
280
264
|
};
|
|
281
|
-
declare function getFilter<T extends FilterType>(filters: Record<string, Filter>, { column, type, owner }: GetFilterOptions<T>): Filter[T] | null;
|
|
282
|
-
|
|
283
265
|
/**
|
|
284
|
-
* Returns a {@link SpatialFilter} for a given viewport, typically obtained
|
|
285
|
-
* from deck.gl's `viewport.getBounds()` method ([west, south, east, north]).
|
|
286
|
-
* If the viewport covers the entire world (to some margin of error in Web
|
|
287
|
-
* Mercator space), `undefined` is returned instead.
|
|
288
266
|
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
|
|
292
|
-
declare function createViewportSpatialFilter(viewport: BBox): SpatialFilter | undefined;
|
|
293
|
-
/**
|
|
294
|
-
* Returns a {@link SpatialFilter} for a given {@link Polygon} or
|
|
295
|
-
* {@link MultiPolygon}. If the polygon(s) extend outside longitude
|
|
296
|
-
* range [-180, +180], the result may be reformatted for compatibility
|
|
297
|
-
* with CARTO APIs.
|
|
267
|
+
* Custom error for reported errors in CARTO Maps API.
|
|
268
|
+
* Provides useful debugging information in console and context for applications.
|
|
269
|
+
*
|
|
298
270
|
*/
|
|
299
|
-
declare
|
|
271
|
+
declare class CartoAPIError extends Error {
|
|
272
|
+
/** Source error from server */
|
|
273
|
+
error: Error;
|
|
274
|
+
/** Context (API call & parameters) in which error occured */
|
|
275
|
+
errorContext: APIErrorContext;
|
|
276
|
+
/** Response from server */
|
|
277
|
+
response?: Response;
|
|
278
|
+
/** JSON Response from server */
|
|
279
|
+
responseJson?: any;
|
|
280
|
+
constructor(error: Error, errorContext: APIErrorContext, response?: Response, responseJson?: any);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** @internal Required by fetchMap(). */
|
|
284
|
+
declare function buildPublicMapUrl({ apiBaseUrl, cartoMapId, }: {
|
|
285
|
+
apiBaseUrl: string;
|
|
286
|
+
cartoMapId: string;
|
|
287
|
+
}): string;
|
|
288
|
+
/** @internal Required by fetchMap(). */
|
|
289
|
+
declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source, type, }: {
|
|
290
|
+
attribute: string;
|
|
291
|
+
apiBaseUrl: string;
|
|
292
|
+
connectionName: string;
|
|
293
|
+
source: string;
|
|
294
|
+
type: MapType;
|
|
295
|
+
}): string;
|
|
300
296
|
|
|
301
297
|
type SourceRequiredOptions = {
|
|
302
298
|
/** Carto platform access token. */
|
|
@@ -394,10 +390,6 @@ type AggregationOptions = {
|
|
|
394
390
|
* @default 6 for quadbin and 4 for h3 sources
|
|
395
391
|
*/
|
|
396
392
|
aggregationResLevel?: number;
|
|
397
|
-
/**
|
|
398
|
-
* Original resolution of the spatial index data as stored in the DW
|
|
399
|
-
*/
|
|
400
|
-
dataResolution?: number;
|
|
401
393
|
};
|
|
402
394
|
type FilterOptions = {
|
|
403
395
|
/**
|
|
@@ -602,8 +594,9 @@ declare enum RasterBandColorinterp {
|
|
|
602
594
|
Alpha = "alpha",
|
|
603
595
|
Palette = "palette"
|
|
604
596
|
}
|
|
597
|
+
type RasterBandType = 'uint8' | 'int8' | 'uint16' | 'int16' | 'uint32' | 'int32' | 'uint64' | 'int64' | 'float32' | 'float64';
|
|
605
598
|
type RasterMetadataBand = {
|
|
606
|
-
type:
|
|
599
|
+
type: RasterBandType;
|
|
607
600
|
name: string;
|
|
608
601
|
stats: RasterMetadataBandStats;
|
|
609
602
|
/**
|
|
@@ -616,7 +609,7 @@ type RasterMetadataBand = {
|
|
|
616
609
|
/**
|
|
617
610
|
* Default color mapping for unique values (or if coloprinterp is `palette`)
|
|
618
611
|
*/
|
|
619
|
-
colortable?: Record<string, number
|
|
612
|
+
colortable?: Record<string, [number, number, number, number]>;
|
|
620
613
|
/**
|
|
621
614
|
* No value representation.
|
|
622
615
|
* Observed values:
|
|
@@ -662,7 +655,399 @@ type QueryResult = {
|
|
|
662
655
|
}[];
|
|
663
656
|
};
|
|
664
657
|
|
|
665
|
-
|
|
658
|
+
type QueryOptions = SourceOptions & QuerySourceOptions;
|
|
659
|
+
declare const query: (options: QueryOptions) => Promise<QueryResult>;
|
|
660
|
+
|
|
661
|
+
declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
|
|
662
|
+
baseUrl: string;
|
|
663
|
+
parameters?: Record<string, unknown>;
|
|
664
|
+
headers?: Record<string, string>;
|
|
665
|
+
errorContext: APIErrorContext;
|
|
666
|
+
maxLengthURL?: number;
|
|
667
|
+
localCache?: LocalCacheOptions;
|
|
668
|
+
}): Promise<T>;
|
|
669
|
+
|
|
670
|
+
type LayerType = 'clusterTile' | 'h3' | 'heatmapTile' | 'mvt' | 'quadbin' | 'raster' | 'tileset';
|
|
671
|
+
|
|
672
|
+
declare const SCALE_FUNCS: Record<string, () => any>;
|
|
673
|
+
type SCALE_TYPE = keyof typeof SCALE_FUNCS;
|
|
674
|
+
declare const AGGREGATION: Record<string, string>;
|
|
675
|
+
declare const OPACITY_MAP: Record<string, string>;
|
|
676
|
+
declare function getLayerProps(type: LayerType, config: MapLayerConfig, dataset: Dataset): {
|
|
677
|
+
propMap: any;
|
|
678
|
+
defaultProps: any;
|
|
679
|
+
};
|
|
680
|
+
declare function domainFromValues(values: any, scaleType: SCALE_TYPE): any;
|
|
681
|
+
declare function opacityToAlpha(opacity?: number): number;
|
|
682
|
+
declare function getColorValueAccessor({ name }: VisualChannelField, colorAggregation: string, data: any): any;
|
|
683
|
+
declare function getColorAccessor({ name, colorColumn }: VisualChannelField, scaleType: SCALE_TYPE, { aggregation, range }: {
|
|
684
|
+
aggregation: string;
|
|
685
|
+
range: any;
|
|
686
|
+
}, opacity: number | undefined, data: any): any;
|
|
687
|
+
declare function getIconUrlAccessor(field: VisualChannelField | null | undefined, range: CustomMarkersRange | null | undefined, { fallbackUrl, maxIconSize, useMaskedIcons, }: {
|
|
688
|
+
fallbackUrl?: string | null;
|
|
689
|
+
maxIconSize: number;
|
|
690
|
+
useMaskedIcons?: boolean;
|
|
691
|
+
}, data: any): any;
|
|
692
|
+
declare function getMaxMarkerSize(visConfig: VisConfig, visualChannels: VisualChannels): number;
|
|
693
|
+
type Accessor = number | ((d: any, i: any) => number);
|
|
694
|
+
declare function negateAccessor(accessor: Accessor): Accessor;
|
|
695
|
+
declare function getSizeAccessor({ name }: VisualChannelField, scaleType: SCALE_TYPE | undefined, aggregation: string | null | undefined, range: Iterable<Range> | null | undefined, data: any): any;
|
|
696
|
+
declare function getTextAccessor({ name, type }: VisualChannelField, data: any): any;
|
|
697
|
+
|
|
698
|
+
type VisualChannelField = {
|
|
699
|
+
name: string;
|
|
700
|
+
type: string;
|
|
701
|
+
colorColumn?: string;
|
|
702
|
+
};
|
|
703
|
+
type VisualChannels = {
|
|
704
|
+
colorField?: VisualChannelField;
|
|
705
|
+
colorScale?: SCALE_TYPE;
|
|
706
|
+
customMarkersField?: VisualChannelField;
|
|
707
|
+
customMarkersScale?: SCALE_TYPE;
|
|
708
|
+
radiusField?: VisualChannelField;
|
|
709
|
+
radiusScale?: SCALE_TYPE;
|
|
710
|
+
rotationScale?: SCALE_TYPE;
|
|
711
|
+
rotationField?: VisualChannelField;
|
|
712
|
+
sizeField?: VisualChannelField;
|
|
713
|
+
sizeScale?: SCALE_TYPE;
|
|
714
|
+
strokeColorField?: VisualChannelField;
|
|
715
|
+
strokeColorScale?: SCALE_TYPE;
|
|
716
|
+
heightField?: VisualChannelField;
|
|
717
|
+
heightScale?: SCALE_TYPE;
|
|
718
|
+
weightField?: VisualChannelField;
|
|
719
|
+
};
|
|
720
|
+
type ColorRange = {
|
|
721
|
+
category: string;
|
|
722
|
+
colors: string[];
|
|
723
|
+
colorMap: string[][] | undefined;
|
|
724
|
+
name: string;
|
|
725
|
+
type: string;
|
|
726
|
+
};
|
|
727
|
+
type CustomMarkersRange = {
|
|
728
|
+
markerMap: {
|
|
729
|
+
value: string;
|
|
730
|
+
markerUrl?: string;
|
|
731
|
+
}[];
|
|
732
|
+
othersMarker?: string;
|
|
733
|
+
};
|
|
734
|
+
type VisConfig = {
|
|
735
|
+
filled?: boolean;
|
|
736
|
+
opacity?: number;
|
|
737
|
+
enable3d?: boolean;
|
|
738
|
+
colorAggregation?: any;
|
|
739
|
+
colorRange: ColorRange;
|
|
740
|
+
customMarkers?: boolean;
|
|
741
|
+
customMarkersRange?: CustomMarkersRange | null;
|
|
742
|
+
customMarkersUrl?: string | null;
|
|
743
|
+
radius: number;
|
|
744
|
+
radiusRange?: number[];
|
|
745
|
+
sizeAggregation?: any;
|
|
746
|
+
sizeRange?: any;
|
|
747
|
+
strokeColorAggregation?: any;
|
|
748
|
+
strokeOpacity?: number;
|
|
749
|
+
strokeColorRange?: ColorRange;
|
|
750
|
+
heightRange?: any;
|
|
751
|
+
heightAggregation?: any;
|
|
752
|
+
weightAggregation?: any;
|
|
753
|
+
};
|
|
754
|
+
type TextLabel = {
|
|
755
|
+
field: VisualChannelField | null | undefined;
|
|
756
|
+
alignment?: 'center' | 'bottom' | 'top';
|
|
757
|
+
anchor?: 'middle' | 'start' | 'end';
|
|
758
|
+
size: number;
|
|
759
|
+
color?: number[];
|
|
760
|
+
offset?: [number, number];
|
|
761
|
+
outlineColor?: number[];
|
|
762
|
+
};
|
|
763
|
+
type MapLayerConfig = {
|
|
764
|
+
columns?: Record<string, any>;
|
|
765
|
+
color?: number[];
|
|
766
|
+
label?: string;
|
|
767
|
+
dataId: string;
|
|
768
|
+
textLabel: TextLabel[];
|
|
769
|
+
visConfig: VisConfig;
|
|
770
|
+
};
|
|
771
|
+
type MapConfigLayer = {
|
|
772
|
+
type: LayerType;
|
|
773
|
+
id: string;
|
|
774
|
+
config: MapLayerConfig;
|
|
775
|
+
visualChannels: VisualChannels;
|
|
776
|
+
};
|
|
777
|
+
interface CustomStyle {
|
|
778
|
+
url?: string;
|
|
779
|
+
style?: any;
|
|
780
|
+
customAttribution?: string;
|
|
781
|
+
}
|
|
782
|
+
type KeplerMapConfig = {
|
|
783
|
+
filters: any;
|
|
784
|
+
mapState: any;
|
|
785
|
+
mapStyle: {
|
|
786
|
+
styleType: string;
|
|
787
|
+
visibleLayerGroups: Record<string, boolean>;
|
|
788
|
+
};
|
|
789
|
+
popupSettings: any;
|
|
790
|
+
visState: {
|
|
791
|
+
layers: MapConfigLayer[];
|
|
792
|
+
layerBlending: any;
|
|
793
|
+
interactionConfig: any;
|
|
794
|
+
};
|
|
795
|
+
customBaseMaps?: {
|
|
796
|
+
customStyle?: CustomStyle;
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
type BasemapType = 'maplibre' | 'google-maps';
|
|
800
|
+
type Basemap = MapLibreBasemap | GoogleBasemap;
|
|
801
|
+
type BasemapCommon = {
|
|
802
|
+
/**
|
|
803
|
+
* Type of basemap.
|
|
804
|
+
*/
|
|
805
|
+
type: BasemapType;
|
|
806
|
+
/**
|
|
807
|
+
* Custom attribution for style data if not provided by style definition.
|
|
808
|
+
*/
|
|
809
|
+
attribution?: string;
|
|
810
|
+
/**
|
|
811
|
+
* Properties of the basemap. These properties are specific to the basemap type.
|
|
812
|
+
*/
|
|
813
|
+
props: Record<string, any>;
|
|
814
|
+
};
|
|
815
|
+
type MapLibreBasemap = BasemapCommon & {
|
|
816
|
+
type: 'maplibre';
|
|
817
|
+
/**
|
|
818
|
+
* MapLibre map properties.
|
|
819
|
+
*
|
|
820
|
+
* Meant to be passed to directly to `maplibregl.Map` object.
|
|
821
|
+
*/
|
|
822
|
+
props: MapLibreBasemapProps;
|
|
823
|
+
/**
|
|
824
|
+
* Layer groups to be displayed in the basemap.
|
|
825
|
+
*/
|
|
826
|
+
visibleLayerGroups?: Record<string, boolean>;
|
|
827
|
+
/**
|
|
828
|
+
* If `style` has been filtered by `visibleLayerGroups` then this property contains original style object, so user
|
|
829
|
+
* can use `applyLayerGroupFilters` again with new settings.
|
|
830
|
+
*/
|
|
831
|
+
rawStyle?: string | Record<string, any>;
|
|
832
|
+
};
|
|
833
|
+
type MapLibreBasemapProps = {
|
|
834
|
+
style: string | Record<string, any>;
|
|
835
|
+
center: [number, number];
|
|
836
|
+
zoom: number;
|
|
837
|
+
pitch?: number;
|
|
838
|
+
bearing?: number;
|
|
839
|
+
};
|
|
840
|
+
type GoogleBasemap = BasemapCommon & {
|
|
841
|
+
type: 'google-maps';
|
|
842
|
+
/**
|
|
843
|
+
* Google map properties.
|
|
844
|
+
*
|
|
845
|
+
* Meant to be passed to directly to `google.maps.Map` object.
|
|
846
|
+
*/
|
|
847
|
+
props: GoogleBasemapProps;
|
|
848
|
+
};
|
|
849
|
+
type GoogleBasemapProps = {
|
|
850
|
+
mapTypeId: string;
|
|
851
|
+
mapId?: string;
|
|
852
|
+
center?: {
|
|
853
|
+
lat: number;
|
|
854
|
+
lng: number;
|
|
855
|
+
};
|
|
856
|
+
zoom?: number;
|
|
857
|
+
tilt?: number;
|
|
858
|
+
heading?: number;
|
|
859
|
+
};
|
|
860
|
+
type Dataset = {
|
|
861
|
+
id: string;
|
|
862
|
+
type: MapType;
|
|
863
|
+
source: string;
|
|
864
|
+
cache?: number;
|
|
865
|
+
connectionName: string;
|
|
866
|
+
geoColumn: string;
|
|
867
|
+
data: TilejsonResult | GeojsonResult | JsonResult;
|
|
868
|
+
columns: string[];
|
|
869
|
+
format: Format;
|
|
870
|
+
aggregationExp: string;
|
|
871
|
+
aggregationResLevel: number;
|
|
872
|
+
queryParameters: QueryParameters;
|
|
873
|
+
connectionId?: string;
|
|
874
|
+
providerId: ProviderType;
|
|
875
|
+
createdAt?: string;
|
|
876
|
+
updatedAt?: string;
|
|
877
|
+
label?: string;
|
|
878
|
+
color?: string;
|
|
879
|
+
uniqueIdProperty?: string;
|
|
880
|
+
queryTemplate?: string | null;
|
|
881
|
+
name?: string | null;
|
|
882
|
+
spatialIndex?: string | null;
|
|
883
|
+
exportToBucketAvailable?: boolean;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
declare const _default: {
|
|
887
|
+
readonly VOYAGER: string;
|
|
888
|
+
readonly POSITRON: string;
|
|
889
|
+
readonly DARK_MATTER: string;
|
|
890
|
+
readonly VOYAGER_NOLABELS: string;
|
|
891
|
+
readonly POSITRON_NOLABELS: string;
|
|
892
|
+
readonly DARK_MATTER_NOLABELS: string;
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
type LayerDescriptor = {
|
|
896
|
+
type: LayerType;
|
|
897
|
+
props: Record<string, any>;
|
|
898
|
+
filters?: Filters;
|
|
899
|
+
};
|
|
900
|
+
type ParseMapResult = {
|
|
901
|
+
/** Map id. */
|
|
902
|
+
id: string;
|
|
903
|
+
/** Title of map. */
|
|
904
|
+
title: string;
|
|
905
|
+
/** Description of map. */
|
|
906
|
+
description?: string;
|
|
907
|
+
createdAt: string;
|
|
908
|
+
updatedAt: string;
|
|
909
|
+
initialViewState: any;
|
|
910
|
+
/** @deprecated Use `basemap`. */
|
|
911
|
+
mapStyle: any;
|
|
912
|
+
popupSettings: any;
|
|
913
|
+
token: string;
|
|
914
|
+
layers: LayerDescriptor[];
|
|
915
|
+
};
|
|
916
|
+
declare function parseMap(json: any): {
|
|
917
|
+
id: any;
|
|
918
|
+
title: any;
|
|
919
|
+
description: any;
|
|
920
|
+
createdAt: any;
|
|
921
|
+
updatedAt: any;
|
|
922
|
+
initialViewState: any;
|
|
923
|
+
/** @deprecated Use `basemap`. */
|
|
924
|
+
mapStyle: {
|
|
925
|
+
styleType: string;
|
|
926
|
+
visibleLayerGroups: Record<string, boolean>;
|
|
927
|
+
};
|
|
928
|
+
popupSettings: any;
|
|
929
|
+
token: any;
|
|
930
|
+
layers: (LayerDescriptor | undefined)[];
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
type FetchMapOptions = {
|
|
934
|
+
/**
|
|
935
|
+
* CARTO platform access token. Only required for private maps.
|
|
936
|
+
*/
|
|
937
|
+
accessToken?: string;
|
|
938
|
+
/**
|
|
939
|
+
* Base URL of the CARTO Maps API.
|
|
940
|
+
*
|
|
941
|
+
* Example for account located in EU-west region: `https://gcp-eu-west1.api.carto.com`
|
|
942
|
+
*
|
|
943
|
+
* @default https://gcp-us-east1.api.carto.com
|
|
944
|
+
*/
|
|
945
|
+
apiBaseUrl?: string;
|
|
946
|
+
/**
|
|
947
|
+
* Identifier of map created in CARTO Builder.
|
|
948
|
+
*/
|
|
949
|
+
cartoMapId: string;
|
|
950
|
+
clientId?: string;
|
|
951
|
+
/**
|
|
952
|
+
* Custom HTTP headers added to map instantiation and data requests.
|
|
953
|
+
*/
|
|
954
|
+
headers?: Record<string, string>;
|
|
955
|
+
/**
|
|
956
|
+
* Interval in seconds at which to autoRefresh the data. If provided, `onNewData` must also be provided.
|
|
957
|
+
*/
|
|
958
|
+
autoRefresh?: number;
|
|
959
|
+
/**
|
|
960
|
+
* Callback function that will be invoked whenever data in layers is changed. If provided, `autoRefresh` must also be provided.
|
|
961
|
+
*/
|
|
962
|
+
onNewData?: (map: any) => void;
|
|
963
|
+
/**
|
|
964
|
+
* Maximum URL character length. Above this limit, requests use POST.
|
|
965
|
+
* Used to avoid browser and CDN limits.
|
|
966
|
+
* @default {@link DEFAULT_MAX_LENGTH_URL}
|
|
967
|
+
*/
|
|
968
|
+
maxLengthURL?: number;
|
|
969
|
+
};
|
|
970
|
+
type FetchMapResult = ParseMapResult & {
|
|
971
|
+
/**
|
|
972
|
+
* Basemap properties.
|
|
973
|
+
*/
|
|
974
|
+
basemap: Basemap | null;
|
|
975
|
+
stopAutoRefresh?: () => void;
|
|
976
|
+
};
|
|
977
|
+
declare function fetchMap({ accessToken, apiBaseUrl, cartoMapId, clientId, headers, autoRefresh, onNewData, maxLengthURL, }: FetchMapOptions): Promise<FetchMapResult>;
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Get basemap properties for Carto map.
|
|
981
|
+
*
|
|
982
|
+
* For maplibre-based basemaps it returns style or style URL that can be used with `maplibregl.Map` compatible component.
|
|
983
|
+
* * style url is returned for non-filtered standard Carto basemaps or if user used style URL directly in configuration
|
|
984
|
+
* * filtered style object returned for Carto basemaps with layer groups filtered
|
|
985
|
+
*
|
|
986
|
+
* For Google-maps base maps, it returns options that can be used with `google.maps.Map` constructor.
|
|
987
|
+
*/
|
|
988
|
+
declare function fetchBasemapProps({ config, errorContext, applyLayerFilters, }: {
|
|
989
|
+
config: KeplerMapConfig;
|
|
990
|
+
/** By default `fetchBasemapProps` applies layers filters to style. Set this to `false` to disable it. */
|
|
991
|
+
applyLayerFilters?: boolean;
|
|
992
|
+
errorContext?: APIErrorContext;
|
|
993
|
+
}): Promise<Basemap | null>;
|
|
994
|
+
|
|
995
|
+
type FilterTypeOptions<T extends FilterType> = {
|
|
996
|
+
type: T;
|
|
997
|
+
column: string;
|
|
998
|
+
} & Filter[T];
|
|
999
|
+
type AddFilterOptions = FilterTypeOptions<FilterType.IN> | FilterTypeOptions<FilterType.BETWEEN> | FilterTypeOptions<FilterType.CLOSED_OPEN> | FilterTypeOptions<FilterType.TIME> | FilterTypeOptions<FilterType.STRING_SEARCH>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Adds a {@link Filter} to the filter set. Any previous filters with the same
|
|
1002
|
+
* `column` and `type` will be replaced.
|
|
1003
|
+
*/
|
|
1004
|
+
declare function addFilter(filters: Record<string, Filter>, { column, type, values, owner }: AddFilterOptions): Record<string, Filter>;
|
|
1005
|
+
type RemoveFilterOptions = {
|
|
1006
|
+
column: string;
|
|
1007
|
+
owner?: string;
|
|
1008
|
+
};
|
|
1009
|
+
/**
|
|
1010
|
+
* Removes one or more {@link Filter filters} from the filter set. If only
|
|
1011
|
+
* `column` is specified, then all filters on that column are removed. If both
|
|
1012
|
+
* `column` and `owner` are specified, then only filters for that column
|
|
1013
|
+
* associated with the owner are removed.
|
|
1014
|
+
*/
|
|
1015
|
+
declare function removeFilter(filters: Record<string, Filter>, { column, owner }: RemoveFilterOptions): Record<string, Filter>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Clears all {@link Filter filters} from the filter set.
|
|
1018
|
+
*/
|
|
1019
|
+
declare function clearFilters(filters: Record<string, Filter>): Record<string, Filter>;
|
|
1020
|
+
type HasFilterOptions = {
|
|
1021
|
+
column: string;
|
|
1022
|
+
owner?: string;
|
|
1023
|
+
};
|
|
1024
|
+
declare function hasFilter(filters: Record<string, Filter>, { column, owner }: HasFilterOptions): boolean;
|
|
1025
|
+
type GetFilterOptions<T extends FilterType> = {
|
|
1026
|
+
column: string;
|
|
1027
|
+
type: T;
|
|
1028
|
+
owner?: string;
|
|
1029
|
+
};
|
|
1030
|
+
declare function getFilter<T extends FilterType>(filters: Record<string, Filter>, { column, type, owner }: GetFilterOptions<T>): Filter[T] | null;
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* Returns a {@link SpatialFilter} for a given viewport, typically obtained
|
|
1034
|
+
* from deck.gl's `viewport.getBounds()` method ([west, south, east, north]).
|
|
1035
|
+
* If the viewport covers the entire world (to some margin of error in Web
|
|
1036
|
+
* Mercator space), `undefined` is returned instead.
|
|
1037
|
+
*
|
|
1038
|
+
* If the viewport extends beyond longitude range [-180, +180], the polygon
|
|
1039
|
+
* may be reformatted for compatibility with CARTO APIs.
|
|
1040
|
+
*/
|
|
1041
|
+
declare function createViewportSpatialFilter(viewport: BBox): SpatialFilter | undefined;
|
|
1042
|
+
/**
|
|
1043
|
+
* Returns a {@link SpatialFilter} for a given {@link Polygon} or
|
|
1044
|
+
* {@link MultiPolygon}. If the polygon(s) extend outside longitude
|
|
1045
|
+
* range [-180, +180], the result may be reformatted for compatibility
|
|
1046
|
+
* with CARTO APIs.
|
|
1047
|
+
*/
|
|
1048
|
+
declare function createPolygonSpatialFilter(spatialFilter: Polygon | MultiPolygon): SpatialFilter | undefined;
|
|
1049
|
+
|
|
1050
|
+
declare const SOURCE_DEFAULTS: Omit<SourceOptionalOptions, 'clientId'>;
|
|
666
1051
|
|
|
667
1052
|
type BoundaryQuerySourceOptions = SourceOptions & FilterOptions & {
|
|
668
1053
|
columns?: string[];
|
|
@@ -694,8 +1079,6 @@ interface BaseRequestOptions {
|
|
|
694
1079
|
signal?: AbortSignal;
|
|
695
1080
|
spatialFilter?: SpatialFilter;
|
|
696
1081
|
spatialFiltersMode?: SpatialFilterPolyfillMode;
|
|
697
|
-
/** Required for table- and query-based spatial index sources (H3, Quadbin). */
|
|
698
|
-
spatialIndexReferenceViewState?: ViewState;
|
|
699
1082
|
/** Overrides source filters, if any. */
|
|
700
1083
|
filters?: Filters;
|
|
701
1084
|
filterOwner?: string;
|
|
@@ -839,26 +1222,6 @@ type TimeSeriesResponse = {
|
|
|
839
1222
|
/** Response from {@link WidgetRemoteSource#getHistogram}. */
|
|
840
1223
|
type HistogramResponse = number[];
|
|
841
1224
|
|
|
842
|
-
interface ModelSource {
|
|
843
|
-
type: MapType;
|
|
844
|
-
apiVersion: ApiVersion;
|
|
845
|
-
apiBaseUrl: string;
|
|
846
|
-
accessToken: string;
|
|
847
|
-
clientId: string;
|
|
848
|
-
connectionName: string;
|
|
849
|
-
data: string;
|
|
850
|
-
filters?: Record<string, Filter>;
|
|
851
|
-
filtersLogicalOperator?: FilterLogicalOperator;
|
|
852
|
-
spatialFilter?: SpatialFilter;
|
|
853
|
-
queryParameters?: QueryParameters;
|
|
854
|
-
spatialDataColumn?: string;
|
|
855
|
-
spatialDataType?: SpatialDataType;
|
|
856
|
-
spatialFiltersResolution?: number;
|
|
857
|
-
spatialFiltersMode?: SpatialFilterPolyfillMode;
|
|
858
|
-
/** original resolution of the spatial index data as stored in the DW */
|
|
859
|
-
dataResolution?: number;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
1225
|
interface WidgetSourceProps extends Omit<SourceOptions, 'filters'> {
|
|
863
1226
|
apiVersion?: ApiVersion;
|
|
864
1227
|
filters?: Record<string, Filter>;
|
|
@@ -881,7 +1244,6 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps = WidgetSour
|
|
|
881
1244
|
* and stability if many (10+) sources are created and not released.
|
|
882
1245
|
*/
|
|
883
1246
|
destroy(): void;
|
|
884
|
-
protected _getSpatialFiltersResolution(source: Omit<ModelSource, 'type' | 'data'>, spatialFilter?: SpatialFilter, referenceViewState?: ViewState): number | undefined;
|
|
885
1247
|
/**
|
|
886
1248
|
* Returns a list of labeled datapoints for categorical data. Suitable for
|
|
887
1249
|
* charts including grouped bar charts, pie charts, and tree charts.
|
|
@@ -929,6 +1291,23 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps = WidgetSour
|
|
|
929
1291
|
abstract getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
930
1292
|
}
|
|
931
1293
|
|
|
1294
|
+
interface ModelSource {
|
|
1295
|
+
type: MapType;
|
|
1296
|
+
apiVersion: ApiVersion;
|
|
1297
|
+
apiBaseUrl: string;
|
|
1298
|
+
accessToken: string;
|
|
1299
|
+
clientId: string;
|
|
1300
|
+
connectionName: string;
|
|
1301
|
+
data: string;
|
|
1302
|
+
filters?: Record<string, Filter>;
|
|
1303
|
+
filtersLogicalOperator?: FilterLogicalOperator;
|
|
1304
|
+
spatialFilter?: SpatialFilter;
|
|
1305
|
+
queryParameters?: QueryParameters;
|
|
1306
|
+
spatialDataColumn?: string;
|
|
1307
|
+
spatialDataType?: SpatialDataType;
|
|
1308
|
+
spatialFiltersMode?: SpatialFilterPolyfillMode;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
932
1311
|
type WidgetRemoteSourceProps = WidgetSourceProps;
|
|
933
1312
|
/**
|
|
934
1313
|
* Source for Widget API requests.
|
|
@@ -984,36 +1363,6 @@ declare class WidgetQuerySource extends WidgetRemoteSource<LayerQuerySourceOptio
|
|
|
984
1363
|
protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
985
1364
|
}
|
|
986
1365
|
|
|
987
|
-
type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
|
|
988
|
-
type WidgetTableSourceResult = {
|
|
989
|
-
widgetSource: WidgetTableSource;
|
|
990
|
-
};
|
|
991
|
-
/**
|
|
992
|
-
* Source for Widget API requests on a data source defined as a table.
|
|
993
|
-
*
|
|
994
|
-
* Generally not intended to be constructed directly. Instead, call
|
|
995
|
-
* {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
|
|
996
|
-
* which can be shared with map layers. Sources contain a `widgetSource` property,
|
|
997
|
-
* for use by widget implementations.
|
|
998
|
-
*
|
|
999
|
-
* Example:
|
|
1000
|
-
*
|
|
1001
|
-
* ```javascript
|
|
1002
|
-
* import { vectorTableSource } from '@carto/api-client';
|
|
1003
|
-
*
|
|
1004
|
-
* const data = vectorTableSource({
|
|
1005
|
-
* accessToken: '••••',
|
|
1006
|
-
* connectionName: 'carto_dw',
|
|
1007
|
-
* tableName: 'carto-demo-data.demo_tables.retail_stores'
|
|
1008
|
-
* });
|
|
1009
|
-
*
|
|
1010
|
-
* const { widgetSource } = await data;
|
|
1011
|
-
* ```
|
|
1012
|
-
*/
|
|
1013
|
-
declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
|
|
1014
|
-
protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
1366
|
/**
|
|
1018
1367
|
* @internal
|
|
1019
1368
|
* @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
|
|
@@ -1053,6 +1402,7 @@ type TileFeatures = {
|
|
|
1053
1402
|
spatialDataColumn?: string;
|
|
1054
1403
|
spatialFilter: SpatialFilter;
|
|
1055
1404
|
uniqueIdProperty?: string;
|
|
1405
|
+
rasterMetadata?: RasterMetadata;
|
|
1056
1406
|
options?: TileFeatureExtractOptions;
|
|
1057
1407
|
};
|
|
1058
1408
|
/** @privateRemarks Source: @carto/react-core */
|
|
@@ -1061,7 +1411,7 @@ type TileFeatureExtractOptions = {
|
|
|
1061
1411
|
uniqueIdProperty?: string;
|
|
1062
1412
|
};
|
|
1063
1413
|
/** @privateRemarks Source: @carto/react-core */
|
|
1064
|
-
declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
|
|
1414
|
+
declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, rasterMetadata, options, }: TileFeatures): FeatureData[];
|
|
1065
1415
|
|
|
1066
1416
|
declare const FEATURE_GEOM_PROPERTY = "__geomValue";
|
|
1067
1417
|
declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
|
|
@@ -1167,12 +1517,12 @@ type WidgetTilesetSourceResult = {
|
|
|
1167
1517
|
* const { widgetSource } = await data;
|
|
1168
1518
|
* ```
|
|
1169
1519
|
*/
|
|
1170
|
-
declare class WidgetTilesetSource extends WidgetSource<
|
|
1520
|
+
declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = WidgetTilesetSourceProps> extends WidgetSource<Props> {
|
|
1171
1521
|
protected _localImpl: WidgetTilesetSourceImpl | null;
|
|
1172
1522
|
protected _workerImpl: Worker | null;
|
|
1173
1523
|
protected _workerEnabled: boolean;
|
|
1174
1524
|
protected _workerNextRequestId: number;
|
|
1175
|
-
constructor(props:
|
|
1525
|
+
constructor(props: Props);
|
|
1176
1526
|
destroy(): void;
|
|
1177
1527
|
/**
|
|
1178
1528
|
* Returns an initialized Worker, to be reused for the lifecycle of this
|
|
@@ -1208,6 +1558,46 @@ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps>
|
|
|
1208
1558
|
getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1209
1559
|
}
|
|
1210
1560
|
|
|
1561
|
+
type WidgetRasterSourceProps = WidgetTilesetSourceProps & {
|
|
1562
|
+
rasterMetadata: RasterMetadata;
|
|
1563
|
+
spatialDataType: 'quadbin';
|
|
1564
|
+
};
|
|
1565
|
+
type WidgetRasterSourceResult = {
|
|
1566
|
+
widgetSource: WidgetRasterSource;
|
|
1567
|
+
};
|
|
1568
|
+
declare class WidgetRasterSource extends WidgetTilesetSource<WidgetRasterSourceProps> {
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
|
|
1572
|
+
type WidgetTableSourceResult = {
|
|
1573
|
+
widgetSource: WidgetTableSource;
|
|
1574
|
+
};
|
|
1575
|
+
/**
|
|
1576
|
+
* Source for Widget API requests on a data source defined as a table.
|
|
1577
|
+
*
|
|
1578
|
+
* Generally not intended to be constructed directly. Instead, call
|
|
1579
|
+
* {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
|
|
1580
|
+
* which can be shared with map layers. Sources contain a `widgetSource` property,
|
|
1581
|
+
* for use by widget implementations.
|
|
1582
|
+
*
|
|
1583
|
+
* Example:
|
|
1584
|
+
*
|
|
1585
|
+
* ```javascript
|
|
1586
|
+
* import { vectorTableSource } from '@carto/api-client';
|
|
1587
|
+
*
|
|
1588
|
+
* const data = vectorTableSource({
|
|
1589
|
+
* accessToken: '••••',
|
|
1590
|
+
* connectionName: 'carto_dw',
|
|
1591
|
+
* tableName: 'carto-demo-data.demo_tables.retail_stores'
|
|
1592
|
+
* });
|
|
1593
|
+
*
|
|
1594
|
+
* const { widgetSource } = await data;
|
|
1595
|
+
* ```
|
|
1596
|
+
*/
|
|
1597
|
+
declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
|
|
1598
|
+
protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1211
1601
|
type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
1212
1602
|
type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
|
|
1213
1603
|
declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
|
|
@@ -1221,7 +1611,7 @@ type H3TilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
|
|
|
1221
1611
|
declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
|
|
1222
1612
|
|
|
1223
1613
|
type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
|
|
1224
|
-
type RasterSourceResponse = TilejsonResult;
|
|
1614
|
+
type RasterSourceResponse = TilejsonResult & WidgetRasterSourceResult;
|
|
1225
1615
|
declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
|
|
1226
1616
|
|
|
1227
1617
|
type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
@@ -1248,63 +1638,12 @@ type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
|
|
|
1248
1638
|
type VectorTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
|
|
1249
1639
|
declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
|
|
1250
1640
|
|
|
1251
|
-
type APIRequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL' | 'Basemap style';
|
|
1252
|
-
type APIErrorContext = {
|
|
1253
|
-
requestType: APIRequestType;
|
|
1254
|
-
mapId?: string;
|
|
1255
|
-
connection?: string;
|
|
1256
|
-
source?: string;
|
|
1257
|
-
type?: MapType;
|
|
1258
|
-
};
|
|
1259
|
-
/**
|
|
1260
|
-
*
|
|
1261
|
-
* Custom error for reported errors in CARTO Maps API.
|
|
1262
|
-
* Provides useful debugging information in console and context for applications.
|
|
1263
|
-
*
|
|
1264
|
-
*/
|
|
1265
|
-
declare class CartoAPIError extends Error {
|
|
1266
|
-
/** Source error from server */
|
|
1267
|
-
error: Error;
|
|
1268
|
-
/** Context (API call & parameters) in which error occured */
|
|
1269
|
-
errorContext: APIErrorContext;
|
|
1270
|
-
/** Response from server */
|
|
1271
|
-
response?: Response;
|
|
1272
|
-
/** JSON Response from server */
|
|
1273
|
-
responseJson?: any;
|
|
1274
|
-
constructor(error: Error, errorContext: APIErrorContext, response?: Response, responseJson?: any);
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
/** @internal Required by fetchMap(). */
|
|
1278
|
-
declare function buildPublicMapUrl({ apiBaseUrl, cartoMapId, }: {
|
|
1279
|
-
apiBaseUrl: string;
|
|
1280
|
-
cartoMapId: string;
|
|
1281
|
-
}): string;
|
|
1282
|
-
/** @internal Required by fetchMap(). */
|
|
1283
|
-
declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source, type, }: {
|
|
1284
|
-
attribute: string;
|
|
1285
|
-
apiBaseUrl: string;
|
|
1286
|
-
connectionName: string;
|
|
1287
|
-
source: string;
|
|
1288
|
-
type: MapType;
|
|
1289
|
-
}): string;
|
|
1290
|
-
|
|
1291
|
-
type QueryOptions = SourceOptions & QuerySourceOptions;
|
|
1292
|
-
declare const query: (options: QueryOptions) => Promise<QueryResult>;
|
|
1293
|
-
|
|
1294
|
-
declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
|
|
1295
|
-
baseUrl: string;
|
|
1296
|
-
parameters?: Record<string, unknown>;
|
|
1297
|
-
headers?: Record<string, string>;
|
|
1298
|
-
errorContext: APIErrorContext;
|
|
1299
|
-
maxLengthURL?: number;
|
|
1300
|
-
localCache?: LocalCacheOptions;
|
|
1301
|
-
}): Promise<T>;
|
|
1302
|
-
|
|
1303
1641
|
/**
|
|
1304
1642
|
* Resolution conversion function. Takes a WebMercatorViewport and returns
|
|
1305
1643
|
* a H3 resolution such that the screen space size of the hexagons is
|
|
1306
1644
|
* "similar" to the given tileSize on screen. Intended for use with deck.gl.
|
|
1307
1645
|
* @internal
|
|
1646
|
+
* @privateRemarks Source: https://github.com/visgl/deck.gl/blob/master/modules/carto/src/layers/h3-tileset-2d.ts
|
|
1308
1647
|
*/
|
|
1309
1648
|
declare function _getHexagonResolution(viewport: {
|
|
1310
1649
|
zoom: number;
|
|
@@ -1396,4 +1735,4 @@ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterInterv
|
|
|
1396
1735
|
*/
|
|
1397
1736
|
declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
|
|
1398
1737
|
|
|
1399
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, clearFilters, createPolygonSpatialFilter, createViewportSpatialFilter, filterFunctions, geojsonFeatures, getClient, getDataFilterExtensionProps, getFilter, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
|
1738
|
+
export { AGGREGATION, type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, _default as BASEMAP, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type KeplerMapConfig, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, type SCALE_TYPE, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, clearFilters, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getClient, getColorAccessor, getColorValueAccessor, getDataFilterExtensionProps, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|