@deck.gl/carto 8.8.0-alpha.3 → 8.8.0-alpha.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.
- package/dist/dist.dev.js +383 -247
- package/dist/es5/api/layer-map.js +7 -5
- package/dist/es5/api/layer-map.js.map +1 -1
- package/dist/es5/layers/carto-layer.js +3 -1
- package/dist/es5/layers/carto-layer.js.map +1 -1
- package/dist/es5/layers/carto-tile-layer.js +17 -12
- package/dist/es5/layers/carto-tile-layer.js.map +1 -1
- package/dist/es5/layers/h3-tile-layer.js +34 -13
- package/dist/es5/layers/h3-tile-layer.js.map +1 -1
- package/dist/es5/layers/h3-tileset-2d.js +21 -11
- package/dist/es5/layers/h3-tileset-2d.js.map +1 -1
- package/dist/es5/layers/quadkey-tile-layer.js +31 -14
- package/dist/es5/layers/quadkey-tile-layer.js.map +1 -1
- package/dist/es5/layers/quadkey-tileset-2d.js.map +1 -1
- package/dist/es5/layers/schema/carto-tile.js +261 -188
- package/dist/es5/layers/schema/carto-tile.js.map +1 -1
- package/dist/es5/layers/spatial-index-tile-layer.js +92 -0
- package/dist/es5/layers/spatial-index-tile-layer.js.map +1 -0
- package/dist/esm/api/layer-map.js +8 -6
- package/dist/esm/api/layer-map.js.map +1 -1
- package/dist/esm/layers/carto-layer.js +3 -1
- package/dist/esm/layers/carto-layer.js.map +1 -1
- package/dist/esm/layers/carto-tile-layer.js +20 -16
- package/dist/esm/layers/carto-tile-layer.js.map +1 -1
- package/dist/esm/layers/h3-tile-layer.js +24 -10
- package/dist/esm/layers/h3-tile-layer.js.map +1 -1
- package/dist/esm/layers/h3-tileset-2d.js +27 -12
- package/dist/esm/layers/h3-tileset-2d.js.map +1 -1
- package/dist/esm/layers/quadkey-tile-layer.js +22 -13
- package/dist/esm/layers/quadkey-tile-layer.js.map +1 -1
- package/dist/esm/layers/quadkey-tileset-2d.js.map +1 -1
- package/dist/esm/layers/schema/carto-tile.js +174 -189
- package/dist/esm/layers/schema/carto-tile.js.map +1 -1
- package/dist/esm/layers/spatial-index-tile-layer.js +57 -0
- package/dist/esm/layers/spatial-index-tile-layer.js.map +1 -0
- package/dist.min.js +4 -4
- package/package.json +7 -4
- package/src/api/layer-map.ts +16 -7
- package/src/layers/carto-layer.ts +18 -5
- package/src/layers/{carto-tile-layer.js → carto-tile-layer.ts} +63 -26
- package/src/layers/h3-tile-layer.ts +78 -0
- package/src/layers/h3-tileset-2d.ts +118 -0
- package/src/layers/quadkey-tile-layer.ts +68 -0
- package/src/layers/{quadkey-tileset-2d.js → quadkey-tileset-2d.ts} +10 -5
- package/src/layers/schema/carto-tile.ts +221 -0
- package/src/layers/spatial-index-tile-layer.ts +49 -0
- package/typed/api/index.d.ts +4 -0
- package/typed/api/index.d.ts.map +1 -0
- package/typed/api/layer-map.d.ts +54 -0
- package/typed/api/layer-map.d.ts.map +1 -0
- package/typed/api/maps-api-common.d.ts +65 -0
- package/typed/api/maps-api-common.d.ts.map +1 -0
- package/typed/api/maps-client.d.ts +18 -0
- package/typed/api/maps-client.d.ts.map +1 -0
- package/typed/api/maps-v3-client.d.ts +45 -0
- package/typed/api/maps-v3-client.d.ts.map +1 -0
- package/typed/api/parseMap.d.ts +11 -0
- package/typed/api/parseMap.d.ts.map +1 -0
- package/typed/basemap.d.ts +10 -0
- package/typed/basemap.d.ts.map +1 -0
- package/typed/config.d.ts +26 -0
- package/typed/config.d.ts.map +1 -0
- package/typed/index.d.ts +12 -0
- package/typed/index.d.ts.map +1 -0
- package/typed/layers/carto-layer.d.ts +98 -0
- package/typed/layers/carto-layer.d.ts.map +1 -0
- package/typed/layers/carto-tile-layer.d.ts +63 -0
- package/typed/layers/carto-tile-layer.d.ts.map +1 -0
- package/typed/layers/h3-tile-layer.d.ts +23 -0
- package/typed/layers/h3-tile-layer.d.ts.map +1 -0
- package/typed/layers/h3-tileset-2d.d.ts +18 -0
- package/typed/layers/h3-tileset-2d.d.ts.map +1 -0
- package/typed/layers/quadkey-tile-layer.d.ts +23 -0
- package/typed/layers/quadkey-tile-layer.d.ts.map +1 -0
- package/typed/layers/quadkey-tileset-2d.d.ts +15 -0
- package/typed/layers/quadkey-tileset-2d.d.ts.map +1 -0
- package/typed/layers/schema/carto-tile.d.ts +44 -0
- package/typed/layers/schema/carto-tile.d.ts.map +1 -0
- package/typed/layers/spatial-index-tile-layer.d.ts +11 -0
- package/typed/layers/spatial-index-tile-layer.d.ts.map +1 -0
- package/typed/package.json +6 -0
- package/typed/style/color-bins-style.d.ts +9 -0
- package/typed/style/color-bins-style.d.ts.map +1 -0
- package/typed/style/color-categories-style.d.ts +10 -0
- package/typed/style/color-categories-style.d.ts.map +1 -0
- package/typed/style/color-continuous-style.d.ts +9 -0
- package/typed/style/color-continuous-style.d.ts.map +1 -0
- package/typed/style/palette.d.ts +7 -0
- package/typed/style/palette.d.ts.map +1 -0
- package/typed/style/utils.d.ts +8 -0
- package/typed/style/utils.d.ts.map +1 -0
- package/typed/utils.d.ts +2 -0
- package/typed/utils.d.ts.map +1 -0
- package/src/layers/h3-tile-layer.js +0 -44
- package/src/layers/h3-tileset-2d.js +0 -82
- package/src/layers/quadkey-tile-layer.js +0 -42
- package/src/layers/schema/carto-tile.js +0 -195
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// KeyValueObject ========================================
|
|
2
|
+
interface KeyValueObject {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
class KeyValueObjectReader {
|
|
8
|
+
static read(pbf, end?: number): KeyValueObject {
|
|
9
|
+
return pbf.readFields(KeyValueObjectReader._readField, {key: '', value: ''}, end);
|
|
10
|
+
}
|
|
11
|
+
static _readField(this: void, tag: number, obj: KeyValueObject, pbf) {
|
|
12
|
+
if (tag === 1) obj.key = pbf.readString();
|
|
13
|
+
else if (tag === 2) obj.value = pbf.readString();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Properties ========================================
|
|
18
|
+
|
|
19
|
+
export interface Properties {
|
|
20
|
+
data: KeyValueObject[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class PropertiesReader {
|
|
24
|
+
static read(pbf, end?: number) {
|
|
25
|
+
return pbf.readFields(PropertiesReader._readField, {data: []}, end);
|
|
26
|
+
}
|
|
27
|
+
static _readField(this: void, tag: number, obj: Properties, pbf) {
|
|
28
|
+
if (tag === 1) obj.data.push(KeyValueObjectReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Doubles ========================================
|
|
33
|
+
|
|
34
|
+
interface Doubles {
|
|
35
|
+
value: Float32Array;
|
|
36
|
+
size: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
class DoublesReader {
|
|
40
|
+
static read(pbf, end?: number): Doubles {
|
|
41
|
+
// TODO perhaps we can do better and directly map from the source
|
|
42
|
+
// ArrayBuffer using ArrayBuffer.slice()
|
|
43
|
+
const {value, size} = pbf.readFields(DoublesReader._readField, {value: [], size: 0}, end);
|
|
44
|
+
return {value: new Float32Array(value), size};
|
|
45
|
+
}
|
|
46
|
+
static _readField(this: void, tag: number, obj, pbf) {
|
|
47
|
+
if (tag === 1) pbf.readPackedDouble(obj.value);
|
|
48
|
+
else if (tag === 2) obj.size = pbf.readVarint(true);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Ints ========================================
|
|
53
|
+
|
|
54
|
+
interface Ints {
|
|
55
|
+
value: Uint32Array;
|
|
56
|
+
size: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
class IntsReader {
|
|
60
|
+
static read(pbf, end?: number): Ints {
|
|
61
|
+
const {value, size} = pbf.readFields(IntsReader._readField, {value: [], size: 0}, end);
|
|
62
|
+
return {value: new Uint32Array(value), size};
|
|
63
|
+
}
|
|
64
|
+
static _readField(this: void, tag: number, obj, pbf) {
|
|
65
|
+
if (tag === 1) pbf.readPackedVarint(obj.value);
|
|
66
|
+
else if (tag === 2) obj.size = pbf.readVarint(true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// NumericProp ========================================
|
|
71
|
+
|
|
72
|
+
interface NumericProp {
|
|
73
|
+
value: number[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
class NumericPropReader {
|
|
77
|
+
static read(pbf, end?: number): NumericProp {
|
|
78
|
+
return pbf.readFields(NumericPropReader._readField, {value: []}, end);
|
|
79
|
+
}
|
|
80
|
+
static _readField(this: void, tag: number, obj: NumericProp, pbf) {
|
|
81
|
+
if (tag === 1) pbf.readPackedDouble(obj.value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// NumericPropKeyValue ========================================
|
|
86
|
+
interface NumbericPropKeyValue {
|
|
87
|
+
key: string;
|
|
88
|
+
value: NumericProp;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
class NumericPropKeyValueReader {
|
|
92
|
+
static read(pbf, end?: number): NumbericPropKeyValue {
|
|
93
|
+
return pbf.readFields(NumericPropKeyValueReader._readField, {key: '', value: null}, end);
|
|
94
|
+
}
|
|
95
|
+
static _readField(this: void, tag: number, obj: NumbericPropKeyValue, pbf) {
|
|
96
|
+
if (tag === 1) obj.key = pbf.readString();
|
|
97
|
+
else if (tag === 2) obj.value = NumericPropReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Points ========================================
|
|
102
|
+
|
|
103
|
+
interface Points {
|
|
104
|
+
positions: Doubles;
|
|
105
|
+
globalFeatureIds: Ints;
|
|
106
|
+
featureIds: Ints;
|
|
107
|
+
properties: Properties[];
|
|
108
|
+
numericProps: Record<string, NumericProp>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
class PointsReader {
|
|
112
|
+
static read(pbf, end?: number): Points {
|
|
113
|
+
return pbf.readFields(
|
|
114
|
+
PointsReader._readField,
|
|
115
|
+
{positions: null, globalFeatureIds: null, featureIds: null, properties: [], numericProps: {}},
|
|
116
|
+
end
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
static _readField(this: void, tag: number, obj: Points, pbf) {
|
|
120
|
+
if (tag === 1) obj.positions = DoublesReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
121
|
+
else if (tag === 2) obj.globalFeatureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
122
|
+
else if (tag === 3) obj.featureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
123
|
+
else if (tag === 4) obj.properties.push(PropertiesReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
124
|
+
else if (tag === 5) {
|
|
125
|
+
const entry = NumericPropKeyValueReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
126
|
+
obj.numericProps[entry.key] = entry.value;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface Lines extends Points {
|
|
132
|
+
pathIndices: Ints;
|
|
133
|
+
}
|
|
134
|
+
// Lines ========================================
|
|
135
|
+
|
|
136
|
+
class LinesReader {
|
|
137
|
+
static read(pbf, end?: number): Lines {
|
|
138
|
+
return pbf.readFields(
|
|
139
|
+
LinesReader._readField,
|
|
140
|
+
{
|
|
141
|
+
positions: null,
|
|
142
|
+
pathIndices: null,
|
|
143
|
+
globalFeatureIds: null,
|
|
144
|
+
featureIds: null,
|
|
145
|
+
properties: [],
|
|
146
|
+
numericProps: {}
|
|
147
|
+
},
|
|
148
|
+
end
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
static _readField(this: void, tag: number, obj: Lines, pbf) {
|
|
152
|
+
if (tag === 1) obj.positions = DoublesReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
153
|
+
else if (tag === 2) obj.pathIndices = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
154
|
+
else if (tag === 3) obj.globalFeatureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
155
|
+
else if (tag === 4) obj.featureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
156
|
+
else if (tag === 5) obj.properties.push(PropertiesReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
157
|
+
else if (tag === 6) {
|
|
158
|
+
const entry = NumericPropKeyValueReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
159
|
+
obj.numericProps[entry.key] = entry.value;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Polygons ========================================
|
|
164
|
+
|
|
165
|
+
interface Polygons extends Points {
|
|
166
|
+
polygonIndices: Ints;
|
|
167
|
+
primitivePolygonIndices: Ints;
|
|
168
|
+
triangles: Ints;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
class PolygonsReader {
|
|
172
|
+
static read(pbf, end?: number): Polygons {
|
|
173
|
+
return pbf.readFields(
|
|
174
|
+
PolygonsReader._readField,
|
|
175
|
+
{
|
|
176
|
+
positions: null,
|
|
177
|
+
polygonIndices: null,
|
|
178
|
+
globalFeatureIds: null,
|
|
179
|
+
featureIds: null,
|
|
180
|
+
primitivePolygonIndices: null,
|
|
181
|
+
triangles: null,
|
|
182
|
+
properties: [],
|
|
183
|
+
numericProps: {}
|
|
184
|
+
},
|
|
185
|
+
end
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
static _readField(this: void, tag: number, obj: Polygons, pbf) {
|
|
189
|
+
if (tag === 1) obj.positions = DoublesReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
190
|
+
else if (tag === 2) obj.polygonIndices = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
191
|
+
else if (tag === 3) obj.globalFeatureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
192
|
+
else if (tag === 4) obj.featureIds = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
193
|
+
else if (tag === 5)
|
|
194
|
+
obj.primitivePolygonIndices = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
195
|
+
else if (tag === 6) obj.triangles = IntsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
196
|
+
else if (tag === 7) obj.properties.push(PropertiesReader.read(pbf, pbf.readVarint() + pbf.pos));
|
|
197
|
+
else if (tag === 8) {
|
|
198
|
+
const entry = NumericPropKeyValueReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
199
|
+
obj.numericProps[entry.key] = entry.value;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Tile ========================================
|
|
205
|
+
|
|
206
|
+
export interface Tile {
|
|
207
|
+
points: Points;
|
|
208
|
+
lines: Lines;
|
|
209
|
+
polygons: Polygons;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export class TileReader {
|
|
213
|
+
static read(pbf, end?: number): Tile {
|
|
214
|
+
return pbf.readFields(TileReader._readField, {points: null, lines: null, polygons: null}, end);
|
|
215
|
+
}
|
|
216
|
+
static _readField(this: void, tag: number, obj: Tile, pbf) {
|
|
217
|
+
if (tag === 1) obj.points = PointsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
218
|
+
else if (tag === 2) obj.lines = LinesReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
219
|
+
else if (tag === 3) obj.polygons = PolygonsReader.read(pbf, pbf.readVarint() + pbf.pos);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {PickingInfo} from '@deck.gl/core';
|
|
2
|
+
import {TileLayer, _Tile2DHeader as Tile2DHeader} from '@deck.gl/geo-layers';
|
|
3
|
+
|
|
4
|
+
function isFeatureIdDefined(value: unknown): boolean {
|
|
5
|
+
return value !== undefined && value !== null && value !== '';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default class SpatialIndexTileLayer<ExtraProps = {}> extends TileLayer<any, ExtraProps> {
|
|
9
|
+
protected _updateAutoHighlight(info: PickingInfo): void {
|
|
10
|
+
const {hoveredFeatureId} = this.state;
|
|
11
|
+
const hoveredFeature = info.object;
|
|
12
|
+
let newHoveredFeatureId;
|
|
13
|
+
|
|
14
|
+
if (hoveredFeature) {
|
|
15
|
+
newHoveredFeatureId = hoveredFeature.id;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (hoveredFeatureId !== newHoveredFeatureId) {
|
|
19
|
+
let {highlightColor} = this.props;
|
|
20
|
+
if (typeof highlightColor === 'function') {
|
|
21
|
+
highlightColor = highlightColor(info);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.setState({
|
|
25
|
+
highlightColor,
|
|
26
|
+
hoveredFeatureId: newHoveredFeatureId
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getSubLayerPropsByTile(tile: Tile2DHeader) {
|
|
32
|
+
return {
|
|
33
|
+
highlightedObjectIndex: this.getHighlightedObjectIndex(tile),
|
|
34
|
+
highlightColor: this.state.highlightColor
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getHighlightedObjectIndex(tile: Tile2DHeader) {
|
|
39
|
+
const {hoveredFeatureId} = this.state;
|
|
40
|
+
const data = tile.content;
|
|
41
|
+
|
|
42
|
+
const isFeatureIdPresent = isFeatureIdDefined(hoveredFeatureId);
|
|
43
|
+
if (!isFeatureIdPresent || !Array.isArray(data)) {
|
|
44
|
+
return -1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return data.findIndex(feature => feature.id === hoveredFeatureId);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +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,OAAO,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { scaleLinear, scaleOrdinal, scaleLog, scalePoint, scaleQuantile, scaleQuantize, scaleSqrt, scaleThreshold } from 'd3-scale';
|
|
2
|
+
import { Layer, _ConstructorOf as ConstructorOf } from '@deck.gl/core/typed';
|
|
3
|
+
declare const SCALE_FUNCS: {
|
|
4
|
+
linear: typeof scaleLinear;
|
|
5
|
+
ordinal: typeof scaleOrdinal;
|
|
6
|
+
log: typeof scaleLog;
|
|
7
|
+
point: typeof scalePoint;
|
|
8
|
+
quantile: typeof scaleQuantile;
|
|
9
|
+
quantize: typeof scaleQuantize;
|
|
10
|
+
sqrt: typeof scaleSqrt;
|
|
11
|
+
custom: typeof scaleThreshold;
|
|
12
|
+
};
|
|
13
|
+
export declare type SCALE_TYPE = keyof typeof SCALE_FUNCS;
|
|
14
|
+
export declare const AGGREGATION: {
|
|
15
|
+
average: string;
|
|
16
|
+
maximum: string;
|
|
17
|
+
minimum: string;
|
|
18
|
+
sum: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const OPACITY_MAP: {
|
|
21
|
+
getFillColor: string;
|
|
22
|
+
getLineColor: string;
|
|
23
|
+
getTextColor: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function getLayer(type: string, config: any, dataset: any): {
|
|
26
|
+
Layer: ConstructorOf<Layer>;
|
|
27
|
+
propMap: any;
|
|
28
|
+
defaultProps: any;
|
|
29
|
+
};
|
|
30
|
+
declare function domainFromValues(values: any, scaleType: SCALE_TYPE): any;
|
|
31
|
+
export declare function opacityToAlpha(opacity: any): number;
|
|
32
|
+
export declare function getColorValueAccessor({ name }: {
|
|
33
|
+
name: any;
|
|
34
|
+
}, colorAggregation: any, data: any): any;
|
|
35
|
+
export declare function getColorAccessor({ name }: {
|
|
36
|
+
name: any;
|
|
37
|
+
}, scaleType: SCALE_TYPE, { colors, colorMap }: {
|
|
38
|
+
colors: any;
|
|
39
|
+
colorMap: any;
|
|
40
|
+
}, opacity: number | undefined, data: any): any;
|
|
41
|
+
export declare function getSizeAccessor({ name }: {
|
|
42
|
+
name: any;
|
|
43
|
+
}, scaleType: SCALE_TYPE, range: Iterable<Range>, data: any): any;
|
|
44
|
+
export declare function getTextAccessor({ name, type }: {
|
|
45
|
+
name: any;
|
|
46
|
+
type: any;
|
|
47
|
+
}, data: any): any;
|
|
48
|
+
export declare function getTextPixelOffsetAccessor({ alignment, anchor, size }: {
|
|
49
|
+
alignment: any;
|
|
50
|
+
anchor: any;
|
|
51
|
+
size: any;
|
|
52
|
+
}, radius: any): number[] | ((d: any) => number[]);
|
|
53
|
+
export { domainFromValues as _domainFromValues };
|
|
54
|
+
//# sourceMappingURL=layer-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAC,KAAK,EAAE,cAAc,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AASrE,QAAA,MAAM,WAAW;;;;;;;;;CAShB,CAAC;AACF,oBAAY,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAIlD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AA2DF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,MAAM,KAAA,EACN,OAAO,KAAA,GACN;IAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC;IAAC,YAAY,EAAE,GAAG,CAAA;CAAC,CAmDhE;AAkCD,iBAAS,gBAAgB,CAAC,MAAM,KAAA,EAAE,SAAS,EAAE,UAAU,OActD;AA8BD,wBAAgB,cAAc,CAAC,OAAO,KAAA,UAErC;AAED,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,MAAM,EAAE,QAAQ,EAAC;;;CAAA,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,GAAG,OA+BV;AAED,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAC;;CAAA,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,OAS/F;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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const DEFAULT_USER_COMPONENT_IN_URL = "{user}";
|
|
2
|
+
export declare const DEFAULT_REGION_COMPONENT_IN_URL = "{region}";
|
|
3
|
+
export declare type ValuesOf<T extends {}> = T[keyof T];
|
|
4
|
+
export declare const API_VERSIONS: {
|
|
5
|
+
readonly V1: "v1";
|
|
6
|
+
readonly V2: "v2";
|
|
7
|
+
readonly V3: "v3";
|
|
8
|
+
};
|
|
9
|
+
export declare type ApiVersion = ValuesOf<typeof API_VERSIONS>;
|
|
10
|
+
export declare const DEFAULT_MAPS_URL_FORMAT: {
|
|
11
|
+
readonly v1: "https://{user}.carto.com/api/v1/map";
|
|
12
|
+
readonly v2: "https://maps-api-v2.{region}.carto.com/user/{user}";
|
|
13
|
+
};
|
|
14
|
+
export declare const MAP_TYPES: {
|
|
15
|
+
readonly QUERY: "query";
|
|
16
|
+
readonly TABLE: "table";
|
|
17
|
+
readonly TILESET: "tileset";
|
|
18
|
+
};
|
|
19
|
+
export declare type MapType = ValuesOf<typeof MAP_TYPES>;
|
|
20
|
+
export declare const COLUMNS_SUPPORT: MapType[];
|
|
21
|
+
export declare const GEO_COLUMN_SUPPORT: MapType[];
|
|
22
|
+
export declare const FORMATS: {
|
|
23
|
+
readonly GEOJSON: "geojson";
|
|
24
|
+
readonly NDJSON: "ndjson";
|
|
25
|
+
readonly TILEJSON: "tilejson";
|
|
26
|
+
readonly JSON: "json";
|
|
27
|
+
};
|
|
28
|
+
export declare type Format = ValuesOf<typeof FORMATS>;
|
|
29
|
+
export declare const TILE_FORMATS: {
|
|
30
|
+
readonly MVT: "mvt";
|
|
31
|
+
readonly JSON: "json";
|
|
32
|
+
readonly GEOJSON: "geojson";
|
|
33
|
+
readonly BINARY: "binary";
|
|
34
|
+
};
|
|
35
|
+
export declare type TileFormat = ValuesOf<typeof TILE_FORMATS>;
|
|
36
|
+
export declare enum SchemaFieldType {
|
|
37
|
+
Number = "number",
|
|
38
|
+
Bigint = "bigint",
|
|
39
|
+
String = "string",
|
|
40
|
+
Geometry = "geometry",
|
|
41
|
+
Timestamp = "timestamp",
|
|
42
|
+
Object = "object",
|
|
43
|
+
Boolean = "boolean",
|
|
44
|
+
Variant = "variant",
|
|
45
|
+
Unknown = "unknown"
|
|
46
|
+
}
|
|
47
|
+
export interface SchemaField {
|
|
48
|
+
name: string;
|
|
49
|
+
type: SchemaFieldType;
|
|
50
|
+
}
|
|
51
|
+
export interface MapInstantiation extends MapInstantiationFormats {
|
|
52
|
+
nrows: number;
|
|
53
|
+
size?: number;
|
|
54
|
+
schema: SchemaField[];
|
|
55
|
+
}
|
|
56
|
+
declare type MapInstantiationFormats = Record<Format, {
|
|
57
|
+
url: string[];
|
|
58
|
+
error?: any;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Simple encode parameter
|
|
62
|
+
*/
|
|
63
|
+
export declare function encodeParameter(name: string, value: string | boolean | number): string;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=maps-api-common.d.ts.map
|
|
@@ -0,0 +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,+BAA+B,aAAa,CAAC;AAE1D,oBAAY,QAAQ,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AACX,oBAAY,UAAU,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,eAAO,MAAM,uBAAuB;;;CAG1B,CAAC;AAEX,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AACX,oBAAY,OAAO,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AACjD,eAAO,MAAM,eAAe,EAAE,OAAO,EAAsB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,EAAE,OAAO,EAAuC,CAAC;AAGhF,eAAO,MAAM,OAAO;;;;;CAKV,CAAC;AACX,oBAAY,MAAM,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAG9C,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,oBAAY,UAAU,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps API Client for Maps API v1 and Maps API v2
|
|
3
|
+
*/
|
|
4
|
+
import { ClassicCredentials } from '../config';
|
|
5
|
+
import { MapType } from './maps-api-common';
|
|
6
|
+
export declare const CONNECTIONS: {
|
|
7
|
+
BIGQUERY: string;
|
|
8
|
+
CARTO: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Obtain a TileJson from Maps API v1 and v2
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDataV2({ type, source, credentials }: {
|
|
14
|
+
type: MapType;
|
|
15
|
+
source: string;
|
|
16
|
+
credentials?: Partial<ClassicCredentials>;
|
|
17
|
+
}): Promise<any>;
|
|
18
|
+
//# sourceMappingURL=maps-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,kBAAkB,EAInB,MAAM,WAAW,CAAC;AACnB,OAAO,EAML,OAAO,EAER,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAKF;;GAEG;AACH,wBAAsB,SAAS,CAAC,EAC9B,IAAI,EACJ,MAAM,EACN,WAAW,EACZ,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3C,gBAkCA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps API Client for Carto 3
|
|
3
|
+
*/
|
|
4
|
+
import { CloudNativeCredentials } from '../config';
|
|
5
|
+
import { Format, MapInstantiation, MapType, SchemaField, TileFormat } from './maps-api-common';
|
|
6
|
+
declare type FetchLayerDataParams = {
|
|
7
|
+
type: MapType;
|
|
8
|
+
source: string;
|
|
9
|
+
connection: string;
|
|
10
|
+
credentials: CloudNativeCredentials;
|
|
11
|
+
geoColumn?: string;
|
|
12
|
+
columns?: string[];
|
|
13
|
+
clientId?: string;
|
|
14
|
+
format?: Format;
|
|
15
|
+
formatTiles?: TileFormat;
|
|
16
|
+
aggregationExp?: string;
|
|
17
|
+
aggregationResLevel?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function mapInstantiation({ type, source, connection, credentials, geoColumn, columns, clientId, aggregationExp, aggregationResLevel }: FetchLayerDataParams): Promise<MapInstantiation>;
|
|
20
|
+
export interface FetchLayerDataResult {
|
|
21
|
+
data: any;
|
|
22
|
+
format?: Format;
|
|
23
|
+
schema: SchemaField[];
|
|
24
|
+
}
|
|
25
|
+
export declare function fetchLayerData({ type, source, connection, credentials, geoColumn, columns, format, formatTiles, clientId, aggregationExp, aggregationResLevel }: FetchLayerDataParams): Promise<FetchLayerDataResult>;
|
|
26
|
+
export declare function getData({ type, source, connection, credentials, geoColumn, columns, format, clientId }: FetchLayerDataParams): Promise<any>;
|
|
27
|
+
export declare function fetchMap({ cartoMapId, clientId, credentials, autoRefresh, onNewData }: {
|
|
28
|
+
cartoMapId: string;
|
|
29
|
+
clientId: string;
|
|
30
|
+
credentials?: CloudNativeCredentials;
|
|
31
|
+
autoRefresh?: number;
|
|
32
|
+
onNewData?: (map: any) => void;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
stopAutoRefresh: (() => void) | undefined;
|
|
35
|
+
id: any;
|
|
36
|
+
title: any;
|
|
37
|
+
description: any;
|
|
38
|
+
createdAt: any;
|
|
39
|
+
updatedAt: any;
|
|
40
|
+
initialViewState: any;
|
|
41
|
+
mapStyle: any;
|
|
42
|
+
layers: (import("@deck.gl/core").Layer<any> | undefined)[];
|
|
43
|
+
}>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=maps-v3-client.d.ts.map
|
|
@@ -0,0 +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,EACpB,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuBlD;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,EACpB,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoBtD;AAgFD,wBAAsB,OAAO,CAAC,EAC5B,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,EAAE,oBAAoB,gBAatB;AA4CD,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;;;;;;;;;GA8BjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function parseMap(json: any): {
|
|
2
|
+
id: any;
|
|
3
|
+
title: any;
|
|
4
|
+
description: any;
|
|
5
|
+
createdAt: any;
|
|
6
|
+
updatedAt: any;
|
|
7
|
+
initialViewState: any;
|
|
8
|
+
mapStyle: any;
|
|
9
|
+
layers: (import("@deck.gl/core").Layer<any> | undefined)[];
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=parseMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseMap.d.ts","sourceRoot":"","sources":["../../src/api/parseMap.ts"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,IAAI,KAAA;;;;;;;;;EAqC5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly VOYAGER: string;
|
|
3
|
+
readonly POSITRON: string;
|
|
4
|
+
readonly DARK_MATTER: string;
|
|
5
|
+
readonly VOYAGER_NOLABELS: string;
|
|
6
|
+
readonly POSITRON_NOLABELS: string;
|
|
7
|
+
readonly DARK_MATTER_NOLABELS: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=basemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basemap.d.ts","sourceRoot":"","sources":["../src/basemap.ts"],"names":[],"mappings":";;;;;;;;AAEA,wBAOW"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const defaultClassicCredentials: {
|
|
2
|
+
readonly apiKey: "default_public";
|
|
3
|
+
readonly region: "us";
|
|
4
|
+
readonly username: "public";
|
|
5
|
+
};
|
|
6
|
+
export declare const defaultCloudNativeCredentials: {
|
|
7
|
+
readonly apiBaseUrl: "https://gcp-us-east1.api.carto.com";
|
|
8
|
+
};
|
|
9
|
+
export interface ClassicCredentials {
|
|
10
|
+
apiVersion: 'v1' | 'v2';
|
|
11
|
+
apiKey: string;
|
|
12
|
+
region: string;
|
|
13
|
+
username: string;
|
|
14
|
+
mapsUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CloudNativeCredentials {
|
|
17
|
+
apiVersion: 'v3';
|
|
18
|
+
apiBaseUrl: string;
|
|
19
|
+
accessToken?: string;
|
|
20
|
+
mapsUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare type Credentials = ClassicCredentials | CloudNativeCredentials;
|
|
23
|
+
export declare function setDefaultCredentials({ apiVersion, ...rest }: Partial<Credentials>): void;
|
|
24
|
+
export declare function getDefaultCredentials(): Credentials;
|
|
25
|
+
export declare function buildMapsUrlFromBase(apiBaseUrl: string): string;
|
|
26
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +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"}
|
package/typed/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { getDefaultCredentials, setDefaultCredentials } from './config';
|
|
2
|
+
export { default as CartoLayer } from './layers/carto-layer';
|
|
3
|
+
export { default as _CartoTileLayer } from './layers/carto-tile-layer';
|
|
4
|
+
export { default as _H3TileLayer } from './layers/h3-tile-layer';
|
|
5
|
+
export { default as _QuadkeyTileLayer } from './layers/quadkey-tile-layer';
|
|
6
|
+
export { default as BASEMAP } from './basemap';
|
|
7
|
+
export { default as colorBins } from './style/color-bins-style';
|
|
8
|
+
export { default as colorCategories } from './style/color-categories-style';
|
|
9
|
+
export { default as colorContinuous } from './style/color-continuous-style';
|
|
10
|
+
export { FORMATS, TILE_FORMATS, MAP_TYPES, API_VERSIONS, fetchLayerData, fetchMap, getDataV2 as _getDataV2, getData, mapInstantiation as _mapInstantiation } from './api';
|
|
11
|
+
export type { CartoLayerProps } from './layers/carto-layer';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACzE,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,OAAO,EACP,gBAAgB,IAAI,iBAAiB,EACtC,MAAM,OAAO,CAAC;AAEf,YAAY,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { CompositeLayer, Layer } from '@deck.gl/core/typed';
|
|
2
|
+
import { Format, MapType, TileFormat } from '../api/maps-api-common';
|
|
3
|
+
import { Credentials } from '../config';
|
|
4
|
+
import { CompositeLayerProps, LayerProps } from 'modules/core/src/types/layer-props';
|
|
5
|
+
import { ChangeFlags } from 'modules/core/src/lib/layer-state';
|
|
6
|
+
/** All properties supported by CartoLayer. */
|
|
7
|
+
export declare type CartoLayerProps<DataT = any> = _CartoLayerProps & CompositeLayerProps<DataT>;
|
|
8
|
+
/** Properties added by CartoLayer. */
|
|
9
|
+
declare type _CartoLayerProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Either a SQL query or a name of dataset/tileset.
|
|
12
|
+
*/
|
|
13
|
+
data: string;
|
|
14
|
+
/**
|
|
15
|
+
* Data type.
|
|
16
|
+
*
|
|
17
|
+
* Possible values are:
|
|
18
|
+
* * `MAP_TYPES.QUERY`, if data is a SQL query.
|
|
19
|
+
* * `MAP_TYPES.TILESET`, if data is a tileset name.
|
|
20
|
+
* * `MAP_TYPES.TABLE`, if data is a dataset name. Only supported with API v3.
|
|
21
|
+
*/
|
|
22
|
+
type: MapType;
|
|
23
|
+
/**
|
|
24
|
+
* Name of the connection registered in the CARTO workspace.
|
|
25
|
+
*
|
|
26
|
+
* Required when apiVersion is `API_VERSIONS.V3`.
|
|
27
|
+
*/
|
|
28
|
+
connection?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Use to override the default data format.
|
|
31
|
+
*
|
|
32
|
+
* Only supported when apiVersion is `API_VERSIONS.V3`.
|
|
33
|
+
*
|
|
34
|
+
* Possible values are: `FORMATS.GEOJSON`, `FORMATS.JSON` and `FORMATS.TILEJSON`.
|
|
35
|
+
*/
|
|
36
|
+
format?: Format;
|
|
37
|
+
/**
|
|
38
|
+
* Use to override the default tile data format.
|
|
39
|
+
*
|
|
40
|
+
* Only supported when apiVersion is `API_VERSIONS.V3` and format is `FORMATS.TILEJSON`.
|
|
41
|
+
*
|
|
42
|
+
* Possible values are: `TILE_FORMATS.BINARY`, `TILE_FORMATS.GEOJSON` and `TILE_FORMATS.MVT`.
|
|
43
|
+
*/
|
|
44
|
+
formatTiles?: TileFormat;
|
|
45
|
+
/**
|
|
46
|
+
* Name of the geo_column in the CARTO platform.
|
|
47
|
+
*
|
|
48
|
+
* Use this override the default column (`'geom'`), from which the geometry information should be fetched.
|
|
49
|
+
*
|
|
50
|
+
* Only supported when apiVersion is `API_VERSIONS.V3` and type is `MAP_TYPES.TABLE`.
|
|
51
|
+
*/
|
|
52
|
+
geoColumn?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Names of columns to fetch.
|
|
55
|
+
*
|
|
56
|
+
* By default, all columns are fetched
|
|
57
|
+
*
|
|
58
|
+
* Only supported when apiVersion is `API_VERSIONS.V3` and type is `MAP_TYPES.TABLE`.
|
|
59
|
+
*/
|
|
60
|
+
columns?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* A string pointing to a unique attribute at the result of the query.
|
|
63
|
+
*
|
|
64
|
+
* A unique attribute is needed for highlighting with vector tiles when a feature is split across two or more tiles.
|
|
65
|
+
*/
|
|
66
|
+
uniqueIdProperty?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Overrides the configuration to connect with CARTO.
|
|
69
|
+
*
|
|
70
|
+
* @see Credentials
|
|
71
|
+
*/
|
|
72
|
+
credentials?: Credentials;
|
|
73
|
+
/**
|
|
74
|
+
* Called when the request to the CARTO Maps API failed.
|
|
75
|
+
*
|
|
76
|
+
* By default the Error is thrown.
|
|
77
|
+
*/
|
|
78
|
+
onDataError?: (err: unknown) => void;
|
|
79
|
+
clientId?: string;
|
|
80
|
+
};
|
|
81
|
+
export default class CartoLayer<ExtraProps = {}> extends CompositeLayer<Required<_CartoLayerProps> & ExtraProps> {
|
|
82
|
+
static layerName: string;
|
|
83
|
+
static defaultProps: any;
|
|
84
|
+
initializeState(): void;
|
|
85
|
+
get isLoaded(): boolean;
|
|
86
|
+
_checkProps(props: CartoLayerProps): void;
|
|
87
|
+
updateState({ props, oldProps, changeFlags }: {
|
|
88
|
+
props: CartoLayerProps;
|
|
89
|
+
oldProps: CartoLayerProps;
|
|
90
|
+
context: any;
|
|
91
|
+
changeFlags: ChangeFlags;
|
|
92
|
+
}): void;
|
|
93
|
+
_updateData(): Promise<void>;
|
|
94
|
+
_getSubLayerAndProps(): [any, LayerProps];
|
|
95
|
+
renderLayers(): Layer | null;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=carto-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carto-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,EAAM,MAAM,eAAe,CAAC;AAOzD,OAAO,EAEL,MAAM,EAGN,OAAO,EAEP,UAAU,EAEX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,WAAW,EAEZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,mBAAmB,EAAE,UAAU,EAAC,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AA4C7D,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,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;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,IAAI,CAAC;IAErC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,UAAU,GAAG,EAAE,CAAE,SAAQ,cAAc,CACrE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,UAAU,CACxC;IACC,MAAM,CAAC,SAAS,SAAgB;IAChC,MAAM,CAAC,YAAY,MAAuB;IAE1C,eAAe,IAAI,IAAI;IAOvB,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAuCzC,WAAW,CAAC,EACV,KAAK,EACL,QAAQ,EACR,WAAW,EACZ,EAAE;QACD,KAAK,EAAE,eAAe,CAAC;QACvB,QAAQ,EAAE,eAAe,CAAC;QAC1B,OAAO,EAAE,GAAG,CAAC;QACb,WAAW,EAAE,WAAW,CAAC;KAC1B,GAAG,IAAI;IAmBF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAqClC,oBAAoB,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC;IAqCzC,YAAY,IAAI,KAAK,GAAG,IAAI;CAqB7B"}
|