@deck.gl/carto 8.10.0-alpha.2 → 8.10.0-alpha.5
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/LICENSE +1 -1
- package/dist/cartoRasterTile-worker.js +1084 -0
- package/dist/cartoSpatialTile-worker.js +1469 -0
- package/dist/cartoVectorTile-worker.js +1727 -0
- package/dist/dist.dev.js +2137 -1936
- package/dist/es5/api/carto-api-error.js +3 -7
- package/dist/es5/api/carto-api-error.js.map +1 -1
- package/dist/es5/api/layer-map.js +3 -7
- package/dist/es5/api/layer-map.js.map +1 -1
- package/dist/es5/api/maps-api-common.js +0 -1
- package/dist/es5/api/maps-api-common.js.map +1 -1
- package/dist/es5/api/maps-v3-client.js +5 -20
- package/dist/es5/api/maps-v3-client.js.map +1 -1
- package/dist/es5/index.js +74 -6
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/layers/carto-layer.js +196 -200
- package/dist/es5/layers/carto-layer.js.map +1 -1
- package/dist/es5/layers/h3-tile-layer.js +57 -79
- package/dist/es5/layers/h3-tile-layer.js.map +1 -1
- package/dist/es5/layers/h3-tileset-2d.js +62 -68
- package/dist/es5/layers/h3-tileset-2d.js.map +1 -1
- package/dist/es5/layers/point-label-layer.js +160 -165
- package/dist/es5/layers/point-label-layer.js.map +1 -1
- package/dist/es5/layers/quadbin-layer.js +23 -27
- package/dist/es5/layers/quadbin-layer.js.map +1 -1
- package/dist/es5/layers/quadbin-tile-layer.js +39 -63
- package/dist/es5/layers/quadbin-tile-layer.js.map +1 -1
- package/dist/es5/layers/quadbin-tileset-2d.js +32 -38
- package/dist/es5/layers/quadbin-tileset-2d.js.map +1 -1
- package/dist/es5/layers/raster-layer.js +94 -98
- package/dist/es5/layers/raster-layer.js.map +1 -1
- package/dist/es5/layers/raster-tile-layer.js +37 -58
- package/dist/es5/layers/raster-tile-layer.js.map +1 -1
- package/dist/es5/layers/schema/carto-raster-tile-loader.js +13 -4
- package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +1 -1
- package/dist/es5/layers/schema/carto-raster-tile.js +31 -39
- package/dist/es5/layers/schema/carto-raster-tile.js.map +1 -1
- package/dist/es5/layers/schema/carto-spatial-tile-loader.js +14 -8
- package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +1 -1
- package/dist/es5/layers/schema/carto-spatial-tile.js +36 -47
- package/dist/es5/layers/schema/carto-spatial-tile.js.map +1 -1
- package/dist/es5/layers/schema/carto-tile.js +161 -196
- package/dist/es5/layers/schema/carto-tile.js.map +1 -1
- package/dist/es5/layers/schema/carto-vector-tile-loader.js +64 -4
- package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +1 -1
- package/dist/es5/layers/spatial-index-tile-layer.js +67 -73
- package/dist/es5/layers/spatial-index-tile-layer.js.map +1 -1
- package/dist/es5/layers/utils.js +29 -0
- package/dist/es5/layers/utils.js.map +1 -0
- package/dist/es5/layers/vector-tile-layer.js +163 -0
- package/dist/es5/layers/vector-tile-layer.js.map +1 -0
- package/dist/es5/sources/base-source.js +100 -0
- package/dist/es5/sources/base-source.js.map +1 -0
- package/dist/es5/sources/common.js +48 -0
- package/dist/es5/sources/common.js.map +1 -0
- package/dist/es5/sources/h3-query-source.js +58 -0
- package/dist/es5/sources/h3-query-source.js.map +1 -0
- package/dist/es5/sources/h3-table-source.js +58 -0
- package/dist/es5/sources/h3-table-source.js.map +1 -0
- package/dist/es5/sources/h3-tileset-source.js +43 -0
- package/dist/es5/sources/h3-tileset-source.js.map +1 -0
- package/dist/es5/sources/index.js +94 -0
- package/dist/es5/sources/index.js.map +1 -0
- package/dist/es5/sources/quadbin-query-source.js +58 -0
- package/dist/es5/sources/quadbin-query-source.js.map +1 -0
- package/dist/es5/sources/quadbin-table-source.js +58 -0
- package/dist/es5/sources/quadbin-table-source.js.map +1 -0
- package/dist/es5/sources/quadbin-tileset-source.js +43 -0
- package/dist/es5/sources/quadbin-tileset-source.js.map +1 -0
- package/dist/es5/sources/raster-source.js +43 -0
- package/dist/es5/sources/raster-source.js.map +1 -0
- package/dist/es5/sources/utils.js +136 -0
- package/dist/es5/sources/utils.js.map +1 -0
- package/dist/es5/sources/vector-query-source.js +52 -0
- package/dist/es5/sources/vector-query-source.js.map +1 -0
- package/dist/es5/sources/vector-table-source.js +52 -0
- package/dist/es5/sources/vector-table-source.js.map +1 -0
- package/dist/es5/sources/vector-tileset-source.js +43 -0
- package/dist/es5/sources/vector-tileset-source.js.map +1 -0
- package/dist/es5/utils.js +5 -0
- package/dist/es5/utils.js.map +1 -1
- package/dist/es5/workers/cartoRasterTile.js +10 -0
- package/dist/es5/workers/cartoRasterTile.js.map +1 -0
- package/dist/es5/workers/cartoSpatialTile.js +10 -0
- package/dist/es5/workers/cartoSpatialTile.js.map +1 -0
- package/dist/es5/workers/cartoVectorTile.js +10 -0
- package/dist/es5/workers/cartoVectorTile.js.map +1 -0
- package/dist/esm/api/carto-api-error.js +8 -13
- package/dist/esm/api/carto-api-error.js.map +1 -1
- package/dist/esm/api/layer-map.js +7 -11
- package/dist/esm/api/layer-map.js.map +1 -1
- package/dist/esm/api/maps-api-common.js +3 -4
- package/dist/esm/api/maps-api-common.js.map +1 -1
- package/dist/esm/api/maps-client.js +7 -7
- package/dist/esm/api/maps-client.js.map +1 -1
- package/dist/esm/api/maps-v3-client.js +14 -24
- package/dist/esm/api/maps-v3-client.js.map +1 -1
- package/dist/esm/api/parseMap.js +4 -4
- package/dist/esm/api/parseMap.js.map +1 -1
- package/dist/esm/config.js +3 -3
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layers/carto-layer.js +12 -15
- package/dist/esm/layers/carto-layer.js.map +1 -1
- package/dist/esm/layers/h3-tile-layer.js +24 -43
- package/dist/esm/layers/h3-tile-layer.js.map +1 -1
- package/dist/esm/layers/point-label-layer.js +6 -10
- package/dist/esm/layers/point-label-layer.js.map +1 -1
- package/dist/esm/layers/quadbin-layer.js +2 -5
- package/dist/esm/layers/quadbin-layer.js.map +1 -1
- package/dist/esm/layers/quadbin-tile-layer.js +21 -44
- package/dist/esm/layers/quadbin-tile-layer.js.map +1 -1
- package/dist/esm/layers/raster-layer-vertex.glsl.js +98 -1
- package/dist/esm/layers/raster-layer-vertex.glsl.js.map +1 -1
- package/dist/esm/layers/raster-layer.js +4 -8
- package/dist/esm/layers/raster-layer.js.map +1 -1
- package/dist/esm/layers/raster-tile-layer.js +21 -39
- package/dist/esm/layers/raster-tile-layer.js.map +1 -1
- package/dist/esm/layers/schema/carto-raster-tile-loader.js +12 -4
- package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +1 -1
- package/dist/esm/layers/schema/carto-raster-tile.js +1 -1
- package/dist/esm/layers/schema/carto-raster-tile.js.map +1 -1
- package/dist/esm/layers/schema/carto-spatial-tile-loader.js +13 -8
- package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +1 -1
- package/dist/esm/layers/schema/carto-tile.js +1 -1
- package/dist/esm/layers/schema/carto-tile.js.map +1 -1
- package/dist/esm/layers/schema/carto-vector-tile-loader.js +63 -4
- package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +1 -1
- package/dist/esm/layers/spatial-index-tile-layer.js +2 -5
- package/dist/esm/layers/spatial-index-tile-layer.js.map +1 -1
- package/dist/esm/layers/utils.js +14 -0
- package/dist/esm/layers/utils.js.map +1 -0
- package/dist/esm/layers/{carto-tile-layer.js → vector-tile-layer.js} +39 -18
- package/dist/esm/layers/vector-tile-layer.js.map +1 -0
- package/dist/esm/sources/base-source.js +49 -0
- package/dist/esm/sources/base-source.js.map +1 -0
- package/dist/esm/sources/common.js +26 -0
- package/dist/esm/sources/common.js.map +1 -0
- package/dist/esm/sources/h3-query-source.js +32 -0
- package/dist/esm/sources/h3-query-source.js.map +1 -0
- package/dist/esm/sources/h3-table-source.js +32 -0
- package/dist/esm/sources/h3-table-source.js.map +1 -0
- package/dist/esm/sources/h3-tileset-source.js +14 -0
- package/dist/esm/sources/h3-tileset-source.js.map +1 -0
- package/dist/esm/sources/index.js +12 -0
- package/dist/esm/sources/index.js.map +1 -0
- package/dist/esm/sources/quadbin-query-source.js +32 -0
- package/dist/esm/sources/quadbin-query-source.js.map +1 -0
- package/dist/esm/sources/quadbin-table-source.js +32 -0
- package/dist/esm/sources/quadbin-table-source.js.map +1 -0
- package/dist/esm/sources/quadbin-tileset-source.js +14 -0
- package/dist/esm/sources/quadbin-tileset-source.js.map +1 -0
- package/dist/esm/sources/raster-source.js +14 -0
- package/dist/esm/sources/raster-source.js.map +1 -0
- package/dist/esm/sources/utils.js +69 -0
- package/dist/esm/sources/utils.js.map +1 -0
- package/dist/esm/sources/vector-query-source.js +25 -0
- package/dist/esm/sources/vector-query-source.js.map +1 -0
- package/dist/esm/sources/vector-table-source.js +25 -0
- package/dist/esm/sources/vector-table-source.js.map +1 -0
- package/dist/esm/sources/vector-tileset-source.js +14 -0
- package/dist/esm/sources/vector-tileset-source.js.map +1 -0
- package/dist/esm/style/palette.js +2 -2
- package/dist/esm/style/palette.js.map +1 -1
- package/dist/esm/style/utils.js +1 -1
- package/dist/esm/style/utils.js.map +1 -1
- package/dist/esm/utils.js +3 -0
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/workers/cartoRasterTile.js +4 -0
- package/dist/esm/workers/cartoRasterTile.js.map +1 -0
- package/dist/esm/workers/cartoSpatialTile.js +4 -0
- package/dist/esm/workers/cartoSpatialTile.js.map +1 -0
- package/dist/esm/workers/cartoVectorTile.js +4 -0
- package/dist/esm/workers/cartoVectorTile.js.map +1 -0
- package/dist.min.js +45 -24
- package/package.json +11 -9
- package/src/api/layer-map.ts +4 -8
- package/src/api/maps-api-common.ts +0 -1
- package/src/api/maps-v3-client.ts +6 -5
- package/src/index.ts +34 -5
- package/src/layers/h3-tile-layer.ts +22 -35
- package/src/layers/quadbin-tile-layer.ts +19 -33
- package/src/layers/raster-tile-layer.ts +22 -26
- package/src/layers/schema/carto-raster-tile-loader.ts +26 -6
- package/src/layers/schema/carto-spatial-tile-loader.ts +25 -11
- package/src/layers/schema/carto-tile.ts +1 -1
- package/src/layers/schema/carto-vector-tile-loader.ts +79 -9
- package/src/layers/utils.ts +11 -0
- package/src/layers/{carto-tile-layer.ts → vector-tile-layer.ts} +40 -21
- package/src/sources/base-source.ts +55 -0
- package/src/sources/common.ts +132 -0
- package/src/sources/h3-query-source.ts +45 -0
- package/src/sources/h3-table-source.ts +46 -0
- package/src/sources/h3-tileset-source.ts +16 -0
- package/src/sources/index.ts +32 -0
- package/src/sources/quadbin-query-source.ts +46 -0
- package/src/sources/quadbin-table-source.ts +46 -0
- package/src/sources/quadbin-tileset-source.ts +16 -0
- package/src/sources/raster-source.ts +16 -0
- package/src/sources/utils.ts +63 -0
- package/src/sources/vector-query-source.ts +23 -0
- package/src/sources/vector-table-source.ts +23 -0
- package/src/sources/vector-tileset-source.ts +16 -0
- package/src/utils.ts +6 -0
- package/src/workers/cartoRasterTile.ts +4 -0
- package/src/workers/cartoSpatialTile.ts +4 -0
- package/src/workers/cartoVectorTile.ts +4 -0
- package/typed/api/layer-map.d.ts +2 -3
- package/typed/api/layer-map.d.ts.map +1 -1
- package/typed/api/maps-api-common.d.ts +0 -1
- package/typed/api/maps-api-common.d.ts.map +1 -1
- package/typed/api/maps-v3-client.d.ts +0 -3
- package/typed/api/maps-v3-client.d.ts.map +1 -1
- package/typed/index.d.ts +6 -4
- package/typed/index.d.ts.map +1 -1
- package/typed/layers/h3-tile-layer.d.ts +5 -8
- package/typed/layers/h3-tile-layer.d.ts.map +1 -1
- package/typed/layers/quadbin-tile-layer.d.ts +5 -9
- package/typed/layers/quadbin-tile-layer.d.ts.map +1 -1
- package/typed/layers/raster-tile-layer.d.ts +6 -10
- package/typed/layers/raster-tile-layer.d.ts.map +1 -1
- package/typed/layers/schema/carto-raster-tile-loader.d.ts.map +1 -1
- package/typed/layers/schema/carto-spatial-tile-loader.d.ts.map +1 -1
- package/typed/layers/schema/carto-vector-tile-loader.d.ts.map +1 -1
- package/typed/layers/utils.d.ts +5 -0
- package/typed/layers/utils.d.ts.map +1 -0
- package/typed/layers/{carto-tile-layer.d.ts → vector-tile-layer.d.ts} +11 -7
- package/typed/layers/vector-tile-layer.d.ts.map +1 -0
- package/typed/sources/base-source.d.ts +4 -0
- package/typed/sources/base-source.d.ts.map +1 -0
- package/typed/sources/common.d.ts +116 -0
- package/typed/sources/common.d.ts.map +1 -0
- package/typed/sources/h3-query-source.d.ts +5 -0
- package/typed/sources/h3-query-source.d.ts.map +1 -0
- package/typed/sources/h3-table-source.d.ts +5 -0
- package/typed/sources/h3-table-source.d.ts.map +1 -0
- package/typed/sources/h3-tileset-source.d.ts +5 -0
- package/typed/sources/h3-tileset-source.d.ts.map +1 -0
- package/typed/sources/index.d.ts +23 -0
- package/typed/sources/index.d.ts.map +1 -0
- package/typed/sources/quadbin-query-source.d.ts +5 -0
- package/typed/sources/quadbin-query-source.d.ts.map +1 -0
- package/typed/sources/quadbin-table-source.d.ts +5 -0
- package/typed/sources/quadbin-table-source.d.ts.map +1 -0
- package/typed/sources/quadbin-tileset-source.d.ts +5 -0
- package/typed/sources/quadbin-tileset-source.d.ts.map +1 -0
- package/typed/sources/raster-source.d.ts +5 -0
- package/typed/sources/raster-source.d.ts.map +1 -0
- package/typed/sources/utils.d.ts +15 -0
- package/typed/sources/utils.d.ts.map +1 -0
- package/typed/sources/vector-query-source.d.ts +5 -0
- package/typed/sources/vector-query-source.d.ts.map +1 -0
- package/typed/sources/vector-table-source.d.ts +5 -0
- package/typed/sources/vector-table-source.d.ts.map +1 -0
- package/typed/sources/vector-tileset-source.d.ts +5 -0
- package/typed/sources/vector-tileset-source.d.ts.map +1 -0
- package/typed/utils.d.ts +1 -0
- package/typed/utils.d.ts.map +1 -1
- package/typed/workers/cartoRasterTile.d.ts +2 -0
- package/typed/workers/cartoRasterTile.d.ts.map +1 -0
- package/typed/workers/cartoSpatialTile.d.ts +2 -0
- package/typed/workers/cartoSpatialTile.d.ts.map +1 -0
- package/typed/workers/cartoVectorTile.d.ts +2 -0
- package/typed/workers/cartoVectorTile.d.ts.map +1 -0
- package/dist/es5/layers/carto-tile-layer.js +0 -145
- package/dist/es5/layers/carto-tile-layer.js.map +0 -1
- package/dist/esm/layers/carto-tile-layer.js.map +0 -1
- package/typed/api/index.js +0 -3
- package/typed/api/layer-map.js +0 -264
- package/typed/api/maps-api-common.js +0 -50
- package/typed/api/maps-client.js +0 -125
- package/typed/api/maps-v3-client.js +0 -304
- package/typed/api/parseMap.js +0 -178
- package/typed/basemap.js +0 -9
- package/typed/config.js +0 -35
- package/typed/index.js +0 -10
- package/typed/layers/carto-layer.js +0 -173
- package/typed/layers/carto-tile-layer.d.ts.map +0 -1
- package/typed/layers/carto-tile-layer.js +0 -105
- package/typed/layers/h3-tile-layer.js +0 -47
- package/typed/layers/h3-tileset-2d.js +0 -85
- package/typed/layers/quadkey-tile-layer.d.ts +0 -21
- package/typed/layers/quadkey-tile-layer.d.ts.map +0 -1
- package/typed/layers/quadkey-tile-layer.js +0 -42
- package/typed/layers/quadkey-tileset-2d.d.ts +0 -15
- package/typed/layers/quadkey-tileset-2d.d.ts.map +0 -1
- package/typed/layers/quadkey-tileset-2d.js +0 -36
- package/typed/layers/schema/carto-tile.js +0 -161
- package/typed/layers/spatial-index-tile-layer.js +0 -40
- package/typed/style/color-bins-style.js +0 -12
- package/typed/style/color-categories-style.js +0 -16
- package/typed/style/color-continuous-style.js +0 -12
- package/typed/style/palette.js +0 -62
- package/typed/style/utils.js +0 -15
- package/typed/utils.js +0 -4
package/dist/es5/index.js
CHANGED
|
@@ -23,13 +23,13 @@ Object.defineProperty(exports, "CartoLayer", {
|
|
|
23
23
|
return _cartoLayer.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "VectorTileLayer", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _vectorTileLayer.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "
|
|
32
|
+
Object.defineProperty(exports, "H3TileLayer", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
35
|
return _h3TileLayer.default;
|
|
@@ -41,13 +41,13 @@ Object.defineProperty(exports, "_PointLabelLayer", {
|
|
|
41
41
|
return _pointLabelLayer.default;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
Object.defineProperty(exports, "
|
|
44
|
+
Object.defineProperty(exports, "QuadbinTileLayer", {
|
|
45
45
|
enumerable: true,
|
|
46
46
|
get: function get() {
|
|
47
47
|
return _quadbinTileLayer.default;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
Object.defineProperty(exports, "
|
|
50
|
+
Object.defineProperty(exports, "RasterTileLayer", {
|
|
51
51
|
enumerable: true,
|
|
52
52
|
get: function get() {
|
|
53
53
|
return _rasterTileLayer.default;
|
|
@@ -131,12 +131,78 @@ Object.defineProperty(exports, "_mapInstantiation", {
|
|
|
131
131
|
return _api.mapInstantiation;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
+
Object.defineProperty(exports, "cartoH3QuerySource", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function get() {
|
|
137
|
+
return _sources.cartoH3QuerySource;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(exports, "cartoH3TableSource", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: function get() {
|
|
143
|
+
return _sources.cartoH3TableSource;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "cartoH3TilesetSource", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function get() {
|
|
149
|
+
return _sources.cartoH3TilesetSource;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "cartoRasterSource", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function get() {
|
|
155
|
+
return _sources.cartoRasterSource;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "cartoQuadbinQuerySource", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function get() {
|
|
161
|
+
return _sources.cartoQuadbinQuerySource;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, "cartoQuadbinTableSource", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function get() {
|
|
167
|
+
return _sources.cartoQuadbinTableSource;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "cartoQuadbinTilesetSource", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function get() {
|
|
173
|
+
return _sources.cartoQuadbinTilesetSource;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
Object.defineProperty(exports, "cartoVectorQuerySource", {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function get() {
|
|
179
|
+
return _sources.cartoVectorQuerySource;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, "cartoVectorTableSource", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function get() {
|
|
185
|
+
return _sources.cartoVectorTableSource;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
Object.defineProperty(exports, "cartoVectorTilesetSource", {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: function get() {
|
|
191
|
+
return _sources.cartoVectorTilesetSource;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(exports, "SOURCE_DEFAULTS", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function get() {
|
|
197
|
+
return _sources.SOURCE_DEFAULTS;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
134
200
|
|
|
135
201
|
var _config = require("./config");
|
|
136
202
|
|
|
137
203
|
var _cartoLayer = _interopRequireDefault(require("./layers/carto-layer"));
|
|
138
204
|
|
|
139
|
-
var
|
|
205
|
+
var _vectorTileLayer = _interopRequireDefault(require("./layers/vector-tile-layer"));
|
|
140
206
|
|
|
141
207
|
var _h3TileLayer = _interopRequireDefault(require("./layers/h3-tile-layer"));
|
|
142
208
|
|
|
@@ -155,4 +221,6 @@ var _colorCategoriesStyle = _interopRequireDefault(require("./style/color-catego
|
|
|
155
221
|
var _colorContinuousStyle = _interopRequireDefault(require("./style/color-continuous-style"));
|
|
156
222
|
|
|
157
223
|
var _api = require("./api");
|
|
224
|
+
|
|
225
|
+
var _sources = require("./sources");
|
|
158
226
|
//# sourceMappingURL=index.js.map
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAcA","sourcesContent":["export {getDefaultCredentials, setDefaultCredentials} from './config';\nexport {default as CartoLayer} from './layers/carto-layer'; // <-- REMOVE in v9\nexport {default as VectorTileLayer} from './layers/vector-tile-layer';\nexport {default as H3TileLayer} from './layers/h3-tile-layer';\nexport {default as _PointLabelLayer} from './layers/point-label-layer';\nexport {default as QuadbinTileLayer} from './layers/quadbin-tile-layer';\nexport {default as RasterTileLayer} from './layers/raster-tile-layer';\nexport {default as BASEMAP} from './basemap';\nexport {default as colorBins} from './style/color-bins-style';\nexport {default as colorCategories} from './style/color-categories-style';\nexport {default as colorContinuous} from './style/color-continuous-style';\nexport {\n FORMATS,\n TILE_FORMATS,\n MAP_TYPES,\n API_VERSIONS,\n CartoAPIError,\n fetchLayerData,\n fetchMap,\n getDataV2 as _getDataV2,\n mapInstantiation as _mapInstantiation\n} from './api';\nexport type {APIErrorContext, QueryParameters} from './api';\nexport type {CartoLayerProps} from './layers/carto-layer';\n\nexport {\n cartoH3QuerySource,\n cartoH3TableSource,\n cartoH3TilesetSource,\n cartoRasterSource,\n cartoQuadbinQuerySource,\n cartoQuadbinTableSource,\n cartoQuadbinTilesetSource,\n cartoVectorQuerySource,\n cartoVectorTableSource,\n cartoVectorTilesetSource,\n SOURCE_DEFAULTS\n} from './sources';\nexport type {\n CartoTilejsonResult,\n CartoH3QuerySourceOptions,\n CartoH3TableSourceOptions,\n CartoH3TilesetSourceOptions,\n CartoRasterSourceOptions,\n CartoQuadbinQuerySourceOptions,\n CartoQuadbinTableSourceOptions,\n CartoQuadbinTilesetSourceOptions,\n CartoVectorQuerySourceOptions,\n CartoVectorTableSourceOptions,\n CartoVectorTilesetSourceOptions,\n GeojsonResult,\n JsonResult\n} from './sources';\n"],"file":"index.js"}
|
|
@@ -15,6 +15,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
|
|
18
20
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
21
|
|
|
20
22
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -27,8 +29,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
27
29
|
|
|
28
30
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
31
|
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
-
|
|
32
32
|
var _core = require("@deck.gl/core");
|
|
33
33
|
|
|
34
34
|
var _geoLayers = require("@deck.gl/geo-layers");
|
|
@@ -97,237 +97,233 @@ var CartoLayer = function (_CompositeLayer) {
|
|
|
97
97
|
return _super.apply(this, arguments);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
key: "initializeState",
|
|
102
|
-
value: function initializeState() {
|
|
103
|
-
this.state = {
|
|
104
|
-
data: null,
|
|
105
|
-
apiVersion: null
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}, {
|
|
109
|
-
key: "isLoaded",
|
|
110
|
-
get: function get() {
|
|
111
|
-
return this.getSubLayers().length > 0 && (0, _get2.default)((0, _getPrototypeOf2.default)(CartoLayer.prototype), "isLoaded", this);
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
key: "_checkProps",
|
|
115
|
-
value: function _checkProps(props) {
|
|
116
|
-
var type = props.type,
|
|
117
|
-
credentials = props.credentials,
|
|
118
|
-
connection = props.connection,
|
|
119
|
-
geoColumn = props.geoColumn,
|
|
120
|
-
columns = props.columns;
|
|
100
|
+
var _proto = CartoLayer.prototype;
|
|
121
101
|
|
|
122
|
-
|
|
102
|
+
_proto.initializeState = function initializeState() {
|
|
103
|
+
this.state = {
|
|
104
|
+
data: null,
|
|
105
|
+
apiVersion: null
|
|
106
|
+
};
|
|
107
|
+
};
|
|
123
108
|
|
|
124
|
-
|
|
109
|
+
_proto._checkProps = function _checkProps(props) {
|
|
110
|
+
var type = props.type,
|
|
111
|
+
credentials = props.credentials,
|
|
112
|
+
connection = props.connection,
|
|
113
|
+
geoColumn = props.geoColumn,
|
|
114
|
+
columns = props.columns;
|
|
125
115
|
|
|
126
|
-
|
|
116
|
+
var localCreds = _objectSpread(_objectSpread({}, (0, _config.getDefaultCredentials)()), credentials);
|
|
127
117
|
|
|
128
|
-
|
|
129
|
-
_core.log.assert(type === _mapsApiCommon.MAP_TYPES.QUERY || type === _mapsApiCommon.MAP_TYPES.TILESET, "Invalid type ".concat(type, ". Use type MAP_TYPES.QUERY or MAP_TYPES.TILESET for apiVersion ").concat(apiVersion));
|
|
118
|
+
var apiVersion = localCreds.apiVersion;
|
|
130
119
|
|
|
131
|
-
|
|
120
|
+
_core.log.assert(Object.values(_api.API_VERSIONS).includes(apiVersion), "Invalid apiVersion ".concat(apiVersion, ". Use API_VERSIONS enum."));
|
|
132
121
|
|
|
133
|
-
|
|
122
|
+
if (apiVersion === _api.API_VERSIONS.V1 || apiVersion === _api.API_VERSIONS.V2) {
|
|
123
|
+
_core.log.assert(type === _mapsApiCommon.MAP_TYPES.QUERY || type === _mapsApiCommon.MAP_TYPES.TILESET, "Invalid type ".concat(type, ". Use type MAP_TYPES.QUERY or MAP_TYPES.TILESET for apiVersion ").concat(apiVersion));
|
|
134
124
|
|
|
135
|
-
|
|
136
|
-
} else if (apiVersion === _api.API_VERSIONS.V3) {
|
|
137
|
-
_core.log.assert(connection, 'Missing mandatory connection parameter');
|
|
125
|
+
_core.log.assert(!connection, "Connection prop is not supported for apiVersion ".concat(apiVersion));
|
|
138
126
|
|
|
139
|
-
|
|
127
|
+
_core.log.assert(!geoColumn, "geoColumn prop is not supported for apiVersion ".concat(apiVersion));
|
|
140
128
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
_core.log.assert(!columns, "columns prop is not supported for apiVersion ".concat(apiVersion));
|
|
130
|
+
} else if (apiVersion === _api.API_VERSIONS.V3) {
|
|
131
|
+
_core.log.assert(connection, 'Missing mandatory connection parameter');
|
|
144
132
|
|
|
145
|
-
|
|
146
|
-
_core.log.assert(!geoColumn, "geoColumn prop is only supported for types: ".concat(_mapsApiCommon.GEO_COLUMN_SUPPORT.join()));
|
|
147
|
-
}
|
|
133
|
+
_core.log.assert(Object.values(_mapsApiCommon.MAP_TYPES).includes(type), "Invalid type ".concat(type, ". Use MAP_TYPES enum."));
|
|
148
134
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
135
|
+
if (!_mapsApiCommon.COLUMNS_SUPPORT.includes(type)) {
|
|
136
|
+
_core.log.assert(!columns, "columns prop is only supported for types: ".concat(_mapsApiCommon.COLUMNS_SUPPORT.join()));
|
|
152
137
|
}
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "updateState",
|
|
156
|
-
value: function updateState(_ref) {
|
|
157
|
-
var props = _ref.props,
|
|
158
|
-
oldProps = _ref.oldProps,
|
|
159
|
-
changeFlags = _ref.changeFlags;
|
|
160
|
-
|
|
161
|
-
this._checkProps(props);
|
|
162
|
-
|
|
163
|
-
var shouldUpdateData = changeFlags.dataChanged || props.aggregationExp !== oldProps.aggregationExp || props.aggregationResLevel !== oldProps.aggregationResLevel || props.connection !== oldProps.connection || props.geoColumn !== oldProps.geoColumn || props.formatTiles !== oldProps.formatTiles || props.type !== oldProps.type || JSON.stringify(props.columns) !== JSON.stringify(oldProps.columns) || JSON.stringify(props.credentials) !== JSON.stringify(oldProps.credentials) || JSON.stringify(props.queryParameters) !== JSON.stringify(oldProps.queryParameters);
|
|
164
138
|
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
apiVersion: null
|
|
169
|
-
});
|
|
139
|
+
if (!_mapsApiCommon.GEO_COLUMN_SUPPORT.includes(type)) {
|
|
140
|
+
_core.log.assert(!geoColumn, "geoColumn prop is only supported for types: ".concat(_mapsApiCommon.GEO_COLUMN_SUPPORT.join()));
|
|
141
|
+
}
|
|
170
142
|
|
|
171
|
-
|
|
143
|
+
if (columns) {
|
|
144
|
+
_core.log.assert(Array.isArray(columns), 'columns prop must be an Array');
|
|
172
145
|
}
|
|
173
146
|
}
|
|
174
|
-
}
|
|
175
|
-
key: "_updateData",
|
|
176
|
-
value: function () {
|
|
177
|
-
var _updateData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
178
|
-
var _this$props$onDataLoa, _this$props2, _this$props, type, source, credentials, connection, rest, localConfig, apiVersion, result;
|
|
179
|
-
|
|
180
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
181
|
-
while (1) {
|
|
182
|
-
switch (_context.prev = _context.next) {
|
|
183
|
-
case 0:
|
|
184
|
-
_context.prev = 0;
|
|
185
|
-
_this$props = this.props, type = _this$props.type, source = _this$props.data, credentials = _this$props.credentials, connection = _this$props.connection, rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
186
|
-
localConfig = _objectSpread(_objectSpread({}, (0, _config.getDefaultCredentials)()), credentials);
|
|
187
|
-
apiVersion = localConfig.apiVersion;
|
|
188
|
-
|
|
189
|
-
if (!(apiVersion === _api.API_VERSIONS.V1 || apiVersion === _api.API_VERSIONS.V2)) {
|
|
190
|
-
_context.next = 11;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
_context.next = 7;
|
|
195
|
-
return (0, _api.getDataV2)({
|
|
196
|
-
type: type,
|
|
197
|
-
source: source,
|
|
198
|
-
credentials: credentials
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
case 7:
|
|
202
|
-
_context.t0 = _context.sent;
|
|
203
|
-
result = {
|
|
204
|
-
data: _context.t0
|
|
205
|
-
};
|
|
206
|
-
_context.next = 14;
|
|
207
|
-
break;
|
|
147
|
+
};
|
|
208
148
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
source: source,
|
|
214
|
-
credentials: credentials,
|
|
215
|
-
connection: connection
|
|
216
|
-
}, rest), {}, {
|
|
217
|
-
format: _mapsApiCommon.FORMATS.TILEJSON
|
|
218
|
-
}));
|
|
219
|
-
|
|
220
|
-
case 13:
|
|
221
|
-
result = _context.sent;
|
|
222
|
-
|
|
223
|
-
case 14:
|
|
224
|
-
this.setState(_objectSpread(_objectSpread({}, result), {}, {
|
|
225
|
-
apiVersion: apiVersion
|
|
226
|
-
}));
|
|
227
|
-
(_this$props$onDataLoa = (_this$props2 = this.props).onDataLoad) === null || _this$props$onDataLoa === void 0 ? void 0 : _this$props$onDataLoa.call(_this$props2, result.data, {
|
|
228
|
-
propName: 'data',
|
|
229
|
-
layer: this
|
|
230
|
-
});
|
|
231
|
-
_context.next = 25;
|
|
232
|
-
break;
|
|
149
|
+
_proto.updateState = function updateState(_ref) {
|
|
150
|
+
var props = _ref.props,
|
|
151
|
+
oldProps = _ref.oldProps,
|
|
152
|
+
changeFlags = _ref.changeFlags;
|
|
233
153
|
|
|
234
|
-
|
|
235
|
-
_context.prev = 18;
|
|
236
|
-
_context.t1 = _context["catch"](0);
|
|
154
|
+
this._checkProps(props);
|
|
237
155
|
|
|
238
|
-
|
|
239
|
-
_context.next = 24;
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
156
|
+
var shouldUpdateData = changeFlags.dataChanged || props.aggregationExp !== oldProps.aggregationExp || props.aggregationResLevel !== oldProps.aggregationResLevel || props.connection !== oldProps.connection || props.geoColumn !== oldProps.geoColumn || props.formatTiles !== oldProps.formatTiles || props.type !== oldProps.type || JSON.stringify(props.columns) !== JSON.stringify(oldProps.columns) || JSON.stringify(props.credentials) !== JSON.stringify(oldProps.credentials) || JSON.stringify(props.queryParameters) !== JSON.stringify(oldProps.queryParameters);
|
|
242
157
|
|
|
243
|
-
|
|
244
|
-
|
|
158
|
+
if (shouldUpdateData) {
|
|
159
|
+
this.setState({
|
|
160
|
+
data: null,
|
|
161
|
+
apiVersion: null
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
this._updateData();
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
_proto._updateData = function () {
|
|
169
|
+
var _updateData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
170
|
+
var _this$props$onDataLoa, _this$props2, _this$props, type, source, credentials, connection, rest, localConfig, apiVersion, result;
|
|
171
|
+
|
|
172
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
173
|
+
while (1) {
|
|
174
|
+
switch (_context.prev = _context.next) {
|
|
175
|
+
case 0:
|
|
176
|
+
_context.prev = 0;
|
|
177
|
+
_this$props = this.props, type = _this$props.type, source = _this$props.data, credentials = _this$props.credentials, connection = _this$props.connection, rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
178
|
+
localConfig = _objectSpread(_objectSpread({}, (0, _config.getDefaultCredentials)()), credentials);
|
|
179
|
+
apiVersion = localConfig.apiVersion;
|
|
180
|
+
|
|
181
|
+
if (!(apiVersion === _api.API_VERSIONS.V1 || apiVersion === _api.API_VERSIONS.V2)) {
|
|
182
|
+
_context.next = 11;
|
|
245
183
|
break;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
_context.next = 7;
|
|
187
|
+
return (0, _api.getDataV2)({
|
|
188
|
+
type: type,
|
|
189
|
+
source: source,
|
|
190
|
+
credentials: credentials
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
case 7:
|
|
194
|
+
_context.t0 = _context.sent;
|
|
195
|
+
result = {
|
|
196
|
+
data: _context.t0
|
|
197
|
+
};
|
|
198
|
+
_context.next = 14;
|
|
199
|
+
break;
|
|
200
|
+
|
|
201
|
+
case 11:
|
|
202
|
+
_context.next = 13;
|
|
203
|
+
return (0, _api.fetchLayerData)(_objectSpread(_objectSpread({
|
|
204
|
+
type: type,
|
|
205
|
+
source: source,
|
|
206
|
+
credentials: credentials,
|
|
207
|
+
connection: connection
|
|
208
|
+
}, rest), {}, {
|
|
209
|
+
format: _mapsApiCommon.FORMATS.TILEJSON
|
|
210
|
+
}));
|
|
211
|
+
|
|
212
|
+
case 13:
|
|
213
|
+
result = _context.sent;
|
|
214
|
+
|
|
215
|
+
case 14:
|
|
216
|
+
this.setState(_objectSpread(_objectSpread({}, result), {}, {
|
|
217
|
+
apiVersion: apiVersion
|
|
218
|
+
}));
|
|
219
|
+
(_this$props$onDataLoa = (_this$props2 = this.props).onDataLoad) === null || _this$props$onDataLoa === void 0 ? void 0 : _this$props$onDataLoa.call(_this$props2, result.data, {
|
|
220
|
+
propName: 'data',
|
|
221
|
+
layer: this
|
|
222
|
+
});
|
|
223
|
+
_context.next = 25;
|
|
224
|
+
break;
|
|
225
|
+
|
|
226
|
+
case 18:
|
|
227
|
+
_context.prev = 18;
|
|
228
|
+
_context.t1 = _context["catch"](0);
|
|
229
|
+
|
|
230
|
+
if (!this.props.onDataError) {
|
|
231
|
+
_context.next = 24;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
this.props.onDataError(_context.t1);
|
|
236
|
+
_context.next = 25;
|
|
237
|
+
break;
|
|
246
238
|
|
|
247
|
-
|
|
248
|
-
|
|
239
|
+
case 24:
|
|
240
|
+
throw _context.t1;
|
|
249
241
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
242
|
+
case 25:
|
|
243
|
+
case "end":
|
|
244
|
+
return _context.stop();
|
|
254
245
|
}
|
|
255
|
-
}
|
|
256
|
-
})
|
|
246
|
+
}
|
|
247
|
+
}, _callee, this, [[0, 18]]);
|
|
248
|
+
}));
|
|
257
249
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
250
|
+
function _updateData() {
|
|
251
|
+
return _updateData2.apply(this, arguments);
|
|
252
|
+
}
|
|
261
253
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
254
|
+
return _updateData;
|
|
255
|
+
}();
|
|
256
|
+
|
|
257
|
+
_proto._getSubLayerAndProps = function _getSubLayerAndProps() {
|
|
258
|
+
(0, _utils.assert)(this.state);
|
|
259
|
+
var _this$state = this.state,
|
|
260
|
+
data = _this$state.data,
|
|
261
|
+
apiVersion = _this$state.apiVersion;
|
|
262
|
+
var uniqueIdProperty = defaultProps.uniqueIdProperty;
|
|
263
|
+
var _this$props3 = this.props,
|
|
264
|
+
_notUsed = _this$props3.data,
|
|
265
|
+
propsNoData = (0, _objectWithoutProperties2.default)(_this$props3, _excluded2);
|
|
266
|
+
|
|
267
|
+
var props = _objectSpread({
|
|
268
|
+
uniqueIdProperty: uniqueIdProperty
|
|
269
|
+
}, propsNoData);
|
|
270
|
+
|
|
271
|
+
if (apiVersion === _api.API_VERSIONS.V1 || apiVersion === _api.API_VERSIONS.V2) {
|
|
272
|
+
return [_geoLayers.MVTLayer, props];
|
|
273
|
+
}
|
|
283
274
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
275
|
+
var tileUrl = new URL(data.tiles[0]);
|
|
276
|
+
props.formatTiles = props.formatTiles || tileUrl.searchParams.get('formatTiles');
|
|
277
|
+
return [(0, _layerMap.layerFromTileDataset)(props.formatTiles, data.scheme, props.type), props];
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
_proto.renderLayers = function renderLayers() {
|
|
281
|
+
(0, _utils.assert)(this.state);
|
|
282
|
+
var _this$state2 = this.state,
|
|
283
|
+
apiVersion = _this$state2.apiVersion,
|
|
284
|
+
data = _this$state2.data;
|
|
285
|
+
if (!data) return null;
|
|
286
|
+
var _this$props4 = this.props,
|
|
287
|
+
credentials = _this$props4.credentials,
|
|
288
|
+
updateTriggers = _this$props4.updateTriggers;
|
|
289
|
+
var loadOptions = this.getLoadOptions() || {};
|
|
290
|
+
|
|
291
|
+
if (apiVersion === _api.API_VERSIONS.V3) {
|
|
292
|
+
var _loadOptions$fetch;
|
|
293
|
+
|
|
294
|
+
var localConfig = _objectSpread(_objectSpread({}, (0, _config.getDefaultCredentials)()), credentials);
|
|
295
|
+
|
|
296
|
+
var accessToken = localConfig.accessToken;
|
|
297
|
+
loadOptions.fetch = _objectSpread(_objectSpread({}, loadOptions.fetch), {}, {
|
|
298
|
+
headers: _objectSpread(_objectSpread({}, (_loadOptions$fetch = loadOptions.fetch) === null || _loadOptions$fetch === void 0 ? void 0 : _loadOptions$fetch.headers), {}, {
|
|
299
|
+
Authorization: "Bearer ".concat(accessToken)
|
|
300
|
+
})
|
|
301
|
+
});
|
|
287
302
|
}
|
|
288
|
-
}, {
|
|
289
|
-
key: "renderLayers",
|
|
290
|
-
value: function renderLayers() {
|
|
291
|
-
(0, _utils.assert)(this.state);
|
|
292
|
-
var _this$state2 = this.state,
|
|
293
|
-
apiVersion = _this$state2.apiVersion,
|
|
294
|
-
data = _this$state2.data;
|
|
295
|
-
if (!data) return null;
|
|
296
|
-
var _this$props4 = this.props,
|
|
297
|
-
credentials = _this$props4.credentials,
|
|
298
|
-
updateTriggers = _this$props4.updateTriggers;
|
|
299
|
-
var loadOptions = this.getLoadOptions() || {};
|
|
300
|
-
|
|
301
|
-
if (apiVersion === _api.API_VERSIONS.V3) {
|
|
302
|
-
var _loadOptions$fetch;
|
|
303
|
-
|
|
304
|
-
var localConfig = _objectSpread(_objectSpread({}, (0, _config.getDefaultCredentials)()), credentials);
|
|
305
|
-
|
|
306
|
-
var accessToken = localConfig.accessToken;
|
|
307
|
-
loadOptions.fetch = _objectSpread(_objectSpread({}, loadOptions.fetch), {}, {
|
|
308
|
-
headers: _objectSpread(_objectSpread({}, (_loadOptions$fetch = loadOptions.fetch) === null || _loadOptions$fetch === void 0 ? void 0 : _loadOptions$fetch.headers), {}, {
|
|
309
|
-
Authorization: "Bearer ".concat(accessToken)
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
303
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
304
|
+
var _this$_getSubLayerAnd = this._getSubLayerAndProps(),
|
|
305
|
+
_this$_getSubLayerAnd2 = (0, _slicedToArray2.default)(_this$_getSubLayerAnd, 2),
|
|
306
|
+
layer = _this$_getSubLayerAnd2[0],
|
|
307
|
+
props = _this$_getSubLayerAnd2[1];
|
|
308
|
+
|
|
309
|
+
return new layer(props, this.getSubLayerProps({
|
|
310
|
+
id: "carto-".concat(layer.layerName),
|
|
311
|
+
data: data,
|
|
312
|
+
loadOptions: loadOptions,
|
|
313
|
+
updateTriggers: updateTriggers
|
|
314
|
+
}));
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
(0, _createClass2.default)(CartoLayer, [{
|
|
318
|
+
key: "isLoaded",
|
|
319
|
+
get: function get() {
|
|
320
|
+
return this.getSubLayers().length > 0 && (0, _get2.default)((0, _getPrototypeOf2.default)(CartoLayer.prototype), "isLoaded", this);
|
|
325
321
|
}
|
|
326
322
|
}]);
|
|
327
323
|
return CartoLayer;
|
|
328
324
|
}(_core.CompositeLayer);
|
|
329
325
|
|
|
330
326
|
exports.default = CartoLayer;
|
|
331
|
-
|
|
332
|
-
|
|
327
|
+
CartoLayer.layerName = 'CartoLayer';
|
|
328
|
+
CartoLayer.defaultProps = defaultProps;
|
|
333
329
|
//# sourceMappingURL=carto-layer.js.map
|