@deck.gl/carto 9.0.30 → 9.0.32
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/api/layer-map.d.ts.map +1 -1
- package/dist/api/layer-map.js +10 -1
- package/dist/api/parse-map.js +4 -1
- package/dist/api/types.d.ts +2 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/cartoRasterTile-worker.js +1 -1
- package/dist/cartoSpatialTile-worker.js +1 -1
- package/dist/cartoVectorTile-worker.js +1 -1
- package/dist/dist.dev.js +21 -2
- package/dist/index.cjs +100 -153
- package/dist/index.cjs.map +2 -2
- package/dist/layers/cluster-tile-layer.js +8 -7
- package/dist/layers/h3-tile-layer.js +4 -3
- package/dist/layers/heatmap-tile-layer.js +3 -3
- package/dist/layers/point-label-layer.js +6 -5
- package/dist/layers/post-process-utils.js +89 -85
- package/dist/layers/quadbin-layer.js +4 -3
- package/dist/layers/quadbin-tile-layer.js +4 -3
- package/dist/layers/raster-layer.js +5 -4
- package/dist/layers/raster-tile-layer.js +4 -3
- package/dist/layers/schema/carto-raster-tile-loader.js +1 -1
- package/dist/layers/schema/carto-spatial-tile-loader.js +1 -1
- package/dist/layers/schema/carto-vector-tile-loader.js +1 -1
- package/dist/layers/spatial-index-tile-layer.js +4 -3
- package/dist/layers/vector-tile-layer.js +4 -3
- package/dist.min.js +9 -9
- package/package.json +2 -2
- package/src/api/layer-map.ts +11 -1
- package/src/api/parse-map.ts +12 -2
- package/src/api/types.ts +4 -0
|
@@ -22,8 +22,6 @@ const defaultProps = {
|
|
|
22
22
|
tileSize: DEFAULT_TILE_SIZE
|
|
23
23
|
};
|
|
24
24
|
class ClusterGeoJsonLayer extends TileLayer {
|
|
25
|
-
static { this.layerName = 'ClusterGeoJsonLayer'; }
|
|
26
|
-
static { this.defaultProps = defaultProps; }
|
|
27
25
|
initializeState() {
|
|
28
26
|
super.initializeState();
|
|
29
27
|
this.state.aggregationCache = new WeakMap();
|
|
@@ -52,12 +50,12 @@ class ClusterGeoJsonLayer extends TileLayer {
|
|
|
52
50
|
aggregationCache.set(tile.content, tileAggregationCache);
|
|
53
51
|
}
|
|
54
52
|
const didAggregate = aggregateTile(tile, tileAggregationCache, aggregationLevels, properties, getPosition, getWeight);
|
|
55
|
-
needsUpdate
|
|
53
|
+
needsUpdate || (needsUpdate = didAggregate);
|
|
56
54
|
data.push(...tileAggregationCache.get(aggregationLevels));
|
|
57
55
|
}
|
|
58
56
|
data.sort((a, b) => Number(b.count - a.count));
|
|
59
57
|
const clusterIds = data?.map((tile) => tile.id);
|
|
60
|
-
needsUpdate
|
|
58
|
+
needsUpdate || (needsUpdate = !deepEqual(clusterIds, this.state.clusterIds, 1));
|
|
61
59
|
this.setState({ clusterIds });
|
|
62
60
|
if (needsUpdate) {
|
|
63
61
|
const stats = computeAggregationStats(data, properties);
|
|
@@ -96,10 +94,10 @@ class ClusterGeoJsonLayer extends TileLayer {
|
|
|
96
94
|
return true;
|
|
97
95
|
}
|
|
98
96
|
}
|
|
97
|
+
ClusterGeoJsonLayer.layerName = 'ClusterGeoJsonLayer';
|
|
98
|
+
ClusterGeoJsonLayer.defaultProps = defaultProps;
|
|
99
99
|
// Adapter layer around ClusterLayer that converts tileJSON into TileLayer API
|
|
100
|
-
|
|
101
|
-
static { this.layerName = 'ClusterTileLayer'; }
|
|
102
|
-
static { this.defaultProps = defaultProps; }
|
|
100
|
+
class ClusterTileLayer extends CompositeLayer {
|
|
103
101
|
getLoadOptions() {
|
|
104
102
|
const loadOptions = super.getLoadOptions() || {};
|
|
105
103
|
const tileJSON = this.props.data;
|
|
@@ -125,3 +123,6 @@ export default class ClusterTileLayer extends CompositeLayer {
|
|
|
125
123
|
];
|
|
126
124
|
}
|
|
127
125
|
}
|
|
126
|
+
ClusterTileLayer.layerName = 'ClusterTileLayer';
|
|
127
|
+
ClusterTileLayer.defaultProps = defaultProps;
|
|
128
|
+
export default ClusterTileLayer;
|
|
@@ -19,9 +19,7 @@ const defaultProps = {
|
|
|
19
19
|
data: TilejsonPropType,
|
|
20
20
|
tileSize: DEFAULT_TILE_SIZE
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
static { this.layerName = 'H3TileLayer'; }
|
|
24
|
-
static { this.defaultProps = defaultProps; }
|
|
22
|
+
class H3TileLayer extends CompositeLayer {
|
|
25
23
|
initializeState() {
|
|
26
24
|
H3HexagonLayer._checkH3Lib();
|
|
27
25
|
}
|
|
@@ -64,3 +62,6 @@ export default class H3TileLayer extends CompositeLayer {
|
|
|
64
62
|
];
|
|
65
63
|
}
|
|
66
64
|
}
|
|
65
|
+
H3TileLayer.layerName = 'H3TileLayer';
|
|
66
|
+
H3TileLayer.defaultProps = defaultProps;
|
|
67
|
+
export default H3TileLayer;
|
|
@@ -14,7 +14,6 @@ function unitDensityForCell(cell) {
|
|
|
14
14
|
}
|
|
15
15
|
// Modified polygon layer to draw offscreen and output value expected by heatmap
|
|
16
16
|
class RTTSolidPolygonLayer extends RTTModifier(SolidPolygonLayer) {
|
|
17
|
-
static { this.layerName = 'RTTSolidPolygonLayer'; }
|
|
18
17
|
getShaders(type) {
|
|
19
18
|
const shaders = super.getShaders(type);
|
|
20
19
|
shaders.inject = {
|
|
@@ -52,6 +51,7 @@ uniform float densityFactor;
|
|
|
52
51
|
super.draw(opts);
|
|
53
52
|
}
|
|
54
53
|
}
|
|
54
|
+
RTTSolidPolygonLayer.layerName = 'RTTSolidPolygonLayer';
|
|
55
55
|
// Modify QuadbinTileLayer to apply heatmap post process effect
|
|
56
56
|
const PostProcessQuadbinTileLayer = PostProcessModifier(QuadbinTileLayer, heatmap);
|
|
57
57
|
const defaultProps = {
|
|
@@ -63,8 +63,6 @@ const defaultProps = {
|
|
|
63
63
|
radiusPixels: { type: 'number', min: 0, max: 100, value: 20 }
|
|
64
64
|
};
|
|
65
65
|
class HeatmapTileLayer extends CompositeLayer {
|
|
66
|
-
static { this.layerName = 'HeatmapTileLayer'; }
|
|
67
|
-
static { this.defaultProps = defaultProps; }
|
|
68
66
|
initializeState() {
|
|
69
67
|
this.state = {
|
|
70
68
|
isLoaded: false,
|
|
@@ -162,4 +160,6 @@ class HeatmapTileLayer extends CompositeLayer {
|
|
|
162
160
|
}));
|
|
163
161
|
}
|
|
164
162
|
}
|
|
163
|
+
HeatmapTileLayer.layerName = 'HeatmapTileLayer';
|
|
164
|
+
HeatmapTileLayer.defaultProps = defaultProps;
|
|
165
165
|
export default HeatmapTileLayer;
|
|
@@ -2,7 +2,6 @@ import { CompositeLayer } from '@deck.gl/core';
|
|
|
2
2
|
import { TextLayer, _TextBackgroundLayer as TextBackgroundLayer } from '@deck.gl/layers';
|
|
3
3
|
const [LEFT, TOP, RIGHT, BOTTOM] = [0, 1, 2, 3];
|
|
4
4
|
class EnhancedTextBackgroundLayer extends TextBackgroundLayer {
|
|
5
|
-
static { this.layerName = 'EnhancedTextBackgroundLayer'; }
|
|
6
5
|
getShaders() {
|
|
7
6
|
const shaders = super.getShaders();
|
|
8
7
|
let vs = shaders.vs;
|
|
@@ -13,10 +12,10 @@ class EnhancedTextBackgroundLayer extends TextBackgroundLayer {
|
|
|
13
12
|
return { ...shaders, vs };
|
|
14
13
|
}
|
|
15
14
|
}
|
|
15
|
+
EnhancedTextBackgroundLayer.layerName = 'EnhancedTextBackgroundLayer';
|
|
16
16
|
// TextLayer which includes modified text-background-layer-vertex shader and only renders the
|
|
17
17
|
// primary background layer in the collision pass
|
|
18
18
|
class EnhancedTextLayer extends TextLayer {
|
|
19
|
-
static { this.layerName = 'EnhancedTextLayer'; }
|
|
20
19
|
filterSubLayer({ layer, renderPass }) {
|
|
21
20
|
const background = layer.id.includes('primary-background');
|
|
22
21
|
if (renderPass === 'collision') {
|
|
@@ -25,14 +24,13 @@ class EnhancedTextLayer extends TextLayer {
|
|
|
25
24
|
return !background; // Do not draw background layer in other passes
|
|
26
25
|
}
|
|
27
26
|
}
|
|
27
|
+
EnhancedTextLayer.layerName = 'EnhancedTextLayer';
|
|
28
28
|
const defaultProps = {
|
|
29
29
|
...TextLayer.defaultProps,
|
|
30
30
|
getRadius: { type: 'accessor', value: 1 },
|
|
31
31
|
radiusScale: { type: 'number', min: 0, value: 1 }
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
static { this.layerName = 'PointLabelLayer'; }
|
|
35
|
-
static { this.defaultProps = defaultProps; }
|
|
33
|
+
class PointLabelLayer extends CompositeLayer {
|
|
36
34
|
calculatePixelOffset(secondary) {
|
|
37
35
|
const { getTextAnchor: anchor, getAlignmentBaseline: alignment, getRadius, getSecondaryText, radiusScale, secondarySizeScale, sizeScale } = this.props;
|
|
38
36
|
const xMult = anchor === 'middle' ? 0 : anchor === 'start' ? 1 : -1;
|
|
@@ -148,3 +146,6 @@ export default class PointLabelLayer extends CompositeLayer {
|
|
|
148
146
|
return out;
|
|
149
147
|
}
|
|
150
148
|
}
|
|
149
|
+
PointLabelLayer.layerName = 'PointLabelLayer';
|
|
150
|
+
PointLabelLayer.defaultProps = defaultProps;
|
|
151
|
+
export default PointLabelLayer;
|
|
@@ -19,7 +19,6 @@ function getPostProcessLayer(layer) {
|
|
|
19
19
|
* Dummy Layer that draws nothing, just calls back to root Layer
|
|
20
20
|
*/
|
|
21
21
|
class DrawCallbackLayer extends Layer {
|
|
22
|
-
static { this.layerName = 'DrawCallbackLayer'; }
|
|
23
22
|
initializeState() {
|
|
24
23
|
this.id = `draw-callback-${getPostProcessLayer(this).props.id}`;
|
|
25
24
|
}
|
|
@@ -27,104 +26,109 @@ class DrawCallbackLayer extends Layer {
|
|
|
27
26
|
getPostProcessLayer(this).applyPostProcess();
|
|
28
27
|
}
|
|
29
28
|
}
|
|
29
|
+
DrawCallbackLayer.layerName = 'DrawCallbackLayer';
|
|
30
30
|
/**
|
|
31
31
|
* Modifier that marks a layer for Render-to-Target rendering.
|
|
32
32
|
* Resulting layer must be used as a sublayer of a layer created
|
|
33
33
|
* with `PostProcessModifier`
|
|
34
34
|
*/
|
|
35
35
|
export function RTTModifier(BaseLayer) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
var _a;
|
|
37
|
+
return _a = class RTTLayer extends BaseLayer {
|
|
38
|
+
draw(opts) {
|
|
39
|
+
const { moduleParameters } = opts;
|
|
40
|
+
const { picking } = moduleParameters;
|
|
41
|
+
const postProcessLayer = getPostProcessLayer(this);
|
|
42
|
+
if (!picking.isActive) {
|
|
43
|
+
postProcessLayer.enableRTT(opts);
|
|
44
|
+
}
|
|
45
|
+
// Draw actual layer
|
|
46
|
+
super.draw(opts);
|
|
47
|
+
if (!picking.isActive) {
|
|
48
|
+
postProcessLayer.disableRTT();
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
postProcessLayer.disableRTT();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
51
|
+
},
|
|
52
|
+
_a.layerName = `RTT-${BaseLayer.layerName}`,
|
|
53
|
+
_a;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Modifier that returns the a modified Layer, which applies a
|
|
55
57
|
* postprocess effect to all subLayers created using `RTTModifier`
|
|
56
58
|
*/
|
|
57
59
|
export function PostProcessModifier(BaseLayer, effect) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
var _a;
|
|
61
|
+
return _a = class PostProcessLayer extends BaseLayer {
|
|
62
|
+
initializeState(context) {
|
|
63
|
+
super.initializeState(context);
|
|
64
|
+
this._createTextures();
|
|
65
|
+
this.internalState.postProcess = new PostProcessEffect(effect, this.props);
|
|
66
|
+
this.internalState.postProcess.setup(context);
|
|
67
|
+
}
|
|
68
|
+
updateState(params) {
|
|
69
|
+
super.updateState(params);
|
|
70
|
+
this.internalState.postProcess.setProps(this.props);
|
|
71
|
+
}
|
|
72
|
+
renderLayers() {
|
|
73
|
+
let subLayers = super.renderLayers();
|
|
74
|
+
if (!subLayers) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
subLayers = Array.isArray(subLayers) ? subLayers : [subLayers];
|
|
78
|
+
return [...subLayers, new DrawCallbackLayer()];
|
|
79
|
+
}
|
|
80
|
+
_createTextures() {
|
|
81
|
+
const { device } = this.context;
|
|
82
|
+
this.internalState.renderBuffers = [0, 1].map(i => {
|
|
83
|
+
return device.createFramebuffer({
|
|
84
|
+
id: `layer-fbo-${i}`,
|
|
85
|
+
colorAttachments: [device.createTexture(TEXTURE_PROPS)],
|
|
86
|
+
depthStencilAttachment: 'depth16unorm'
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
_resizeBuffers(opts) {
|
|
91
|
+
// TODO we could likely render to a smaller buffer for better perf
|
|
92
|
+
const { moduleParameters } = opts;
|
|
93
|
+
const { viewport } = this.context;
|
|
94
|
+
const width = moduleParameters.devicePixelRatio * viewport.width;
|
|
95
|
+
const height = moduleParameters.devicePixelRatio * viewport.height;
|
|
96
|
+
this.internalState.renderBuffers.forEach((fbo) => fbo.resize({ width, height }));
|
|
97
|
+
}
|
|
98
|
+
enableRTT(opts) {
|
|
99
|
+
this._resizeBuffers(opts);
|
|
100
|
+
this.internalState.originalRenderPass = this.context.renderPass;
|
|
101
|
+
const [framebuffer] = this.internalState.renderBuffers;
|
|
102
|
+
// Create new render pass for RTT
|
|
103
|
+
this.internalState.internalRenderPass = this.context.device.beginRenderPass({
|
|
104
|
+
framebuffer,
|
|
105
|
+
parameters: { viewport: [0, 0, framebuffer.width, framebuffer.height] },
|
|
106
|
+
// Only clear on first render
|
|
107
|
+
clearColor: this.internalState.renderInProgress ? false : [0, 0, 0, 0]
|
|
108
|
+
});
|
|
109
|
+
this.internalState.renderInProgress = true;
|
|
110
|
+
this.context.renderPass = this.internalState.internalRenderPass;
|
|
111
|
+
}
|
|
112
|
+
disableRTT() {
|
|
113
|
+
// End render pass, and reinstate original
|
|
114
|
+
this.internalState.internalRenderPass.end();
|
|
115
|
+
this.context.renderPass = this.internalState.originalRenderPass;
|
|
74
116
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
117
|
+
applyPostProcess() {
|
|
118
|
+
if (!this.internalState.renderInProgress) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Apply post process effect
|
|
122
|
+
const [inputBuffer, swapBuffer] = this.internalState.renderBuffers;
|
|
123
|
+
const { framebuffer: target } = this.context.renderPass.props;
|
|
124
|
+
this.internalState.postProcess.postRender({
|
|
125
|
+
inputBuffer,
|
|
126
|
+
swapBuffer,
|
|
127
|
+
target
|
|
85
128
|
});
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
_resizeBuffers(opts) {
|
|
89
|
-
// TODO we could likely render to a smaller buffer for better perf
|
|
90
|
-
const { moduleParameters } = opts;
|
|
91
|
-
const { viewport } = this.context;
|
|
92
|
-
const width = moduleParameters.devicePixelRatio * viewport.width;
|
|
93
|
-
const height = moduleParameters.devicePixelRatio * viewport.height;
|
|
94
|
-
this.internalState.renderBuffers.forEach((fbo) => fbo.resize({ width, height }));
|
|
95
|
-
}
|
|
96
|
-
enableRTT(opts) {
|
|
97
|
-
this._resizeBuffers(opts);
|
|
98
|
-
this.internalState.originalRenderPass = this.context.renderPass;
|
|
99
|
-
const [framebuffer] = this.internalState.renderBuffers;
|
|
100
|
-
// Create new render pass for RTT
|
|
101
|
-
this.internalState.internalRenderPass = this.context.device.beginRenderPass({
|
|
102
|
-
framebuffer,
|
|
103
|
-
parameters: { viewport: [0, 0, framebuffer.width, framebuffer.height] },
|
|
104
|
-
// Only clear on first render
|
|
105
|
-
clearColor: this.internalState.renderInProgress ? false : [0, 0, 0, 0]
|
|
106
|
-
});
|
|
107
|
-
this.internalState.renderInProgress = true;
|
|
108
|
-
this.context.renderPass = this.internalState.internalRenderPass;
|
|
109
|
-
}
|
|
110
|
-
disableRTT() {
|
|
111
|
-
// End render pass, and reinstate original
|
|
112
|
-
this.internalState.internalRenderPass.end();
|
|
113
|
-
this.context.renderPass = this.internalState.originalRenderPass;
|
|
114
|
-
}
|
|
115
|
-
applyPostProcess() {
|
|
116
|
-
if (!this.internalState.renderInProgress) {
|
|
117
|
-
return;
|
|
129
|
+
this.internalState.renderInProgress = false;
|
|
118
130
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.internalState.postProcess.postRender({
|
|
123
|
-
inputBuffer,
|
|
124
|
-
swapBuffer,
|
|
125
|
-
target
|
|
126
|
-
});
|
|
127
|
-
this.internalState.renderInProgress = false;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
131
|
+
},
|
|
132
|
+
_a.layerName = `PostProcess${BaseLayer.layerName}`,
|
|
133
|
+
_a;
|
|
130
134
|
}
|
|
@@ -3,9 +3,7 @@ import { getQuadbinPolygon } from "./quadbin-utils.js";
|
|
|
3
3
|
const defaultProps = {
|
|
4
4
|
getQuadbin: { type: 'accessor', value: (d) => d.quadbin }
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
static { this.layerName = 'QuadbinLayer'; }
|
|
8
|
-
static { this.defaultProps = defaultProps; }
|
|
6
|
+
class QuadbinLayer extends GeoCellLayer {
|
|
9
7
|
indexToBounds() {
|
|
10
8
|
const { data, extruded, getQuadbin } = this.props;
|
|
11
9
|
// To avoid z-fighting reduce polygon footprint when extruding
|
|
@@ -19,3 +17,6 @@ export default class QuadbinLayer extends GeoCellLayer {
|
|
|
19
17
|
};
|
|
20
18
|
}
|
|
21
19
|
}
|
|
20
|
+
QuadbinLayer.layerName = 'QuadbinLayer';
|
|
21
|
+
QuadbinLayer.defaultProps = defaultProps;
|
|
22
|
+
export default QuadbinLayer;
|
|
@@ -18,9 +18,7 @@ const defaultProps = {
|
|
|
18
18
|
data: TilejsonPropType,
|
|
19
19
|
tileSize: DEFAULT_TILE_SIZE
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
static { this.layerName = 'QuadbinTileLayer'; }
|
|
23
|
-
static { this.defaultProps = defaultProps; }
|
|
21
|
+
class QuadbinTileLayer extends CompositeLayer {
|
|
24
22
|
getLoadOptions() {
|
|
25
23
|
const loadOptions = super.getLoadOptions() || {};
|
|
26
24
|
const tileJSON = this.props.data;
|
|
@@ -47,3 +45,6 @@ export default class QuadbinTileLayer extends CompositeLayer {
|
|
|
47
45
|
];
|
|
48
46
|
}
|
|
49
47
|
}
|
|
48
|
+
QuadbinTileLayer.layerName = 'QuadbinTileLayer';
|
|
49
|
+
QuadbinTileLayer.defaultProps = defaultProps;
|
|
50
|
+
export default QuadbinTileLayer;
|
|
@@ -16,7 +16,6 @@ const defaultProps = {
|
|
|
16
16
|
};
|
|
17
17
|
// Modified ColumnLayer with custom vertex shader
|
|
18
18
|
class RasterColumnLayer extends ColumnLayer {
|
|
19
|
-
static { this.layerName = 'RasterColumnLayer'; }
|
|
20
19
|
getShaders() {
|
|
21
20
|
const shaders = super.getShaders();
|
|
22
21
|
const data = this.props.data;
|
|
@@ -50,10 +49,9 @@ class RasterColumnLayer extends ColumnLayer {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
}
|
|
52
|
+
RasterColumnLayer.layerName = 'RasterColumnLayer';
|
|
53
53
|
// Adapter layer around RasterColumnLayer that converts data & accessors into correct format
|
|
54
|
-
|
|
55
|
-
static { this.layerName = 'RasterLayer'; }
|
|
56
|
-
static { this.defaultProps = defaultProps; }
|
|
54
|
+
class RasterLayer extends CompositeLayer {
|
|
57
55
|
renderLayers() {
|
|
58
56
|
// Rendering props underlying layer
|
|
59
57
|
const { data, getElevation, getFillColor, getLineColor, getLineWidth, tileIndex, updateTriggers } = this.props;
|
|
@@ -123,3 +121,6 @@ export default class RasterLayer extends CompositeLayer {
|
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
}
|
|
124
|
+
RasterLayer.layerName = 'RasterLayer';
|
|
125
|
+
RasterLayer.defaultProps = defaultProps;
|
|
126
|
+
export default RasterLayer;
|
|
@@ -14,9 +14,7 @@ const defaultProps = {
|
|
|
14
14
|
data: TilejsonPropType,
|
|
15
15
|
tileSize: DEFAULT_TILE_SIZE
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
static { this.layerName = 'RasterTileLayer'; }
|
|
19
|
-
static { this.defaultProps = defaultProps; }
|
|
17
|
+
class RasterTileLayer extends CompositeLayer {
|
|
20
18
|
getLoadOptions() {
|
|
21
19
|
const loadOptions = super.getLoadOptions() || {};
|
|
22
20
|
const tileJSON = this.props.data;
|
|
@@ -43,3 +41,6 @@ export default class RasterTileLayer extends CompositeLayer {
|
|
|
43
41
|
];
|
|
44
42
|
}
|
|
45
43
|
}
|
|
44
|
+
RasterTileLayer.layerName = 'RasterTileLayer';
|
|
45
|
+
RasterTileLayer.defaultProps = defaultProps;
|
|
46
|
+
export default RasterTileLayer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TileReader } from "./carto-raster-tile.js";
|
|
2
2
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
3
3
|
import { getWorkerUrl } from "../../utils.js";
|
|
4
|
-
const VERSION = typeof "9.0.
|
|
4
|
+
const VERSION = typeof "9.0.32" !== 'undefined' ? "9.0.32" : 'latest';
|
|
5
5
|
const id = 'cartoRasterTile';
|
|
6
6
|
const DEFAULT_OPTIONS = {
|
|
7
7
|
cartoRasterTile: {
|
|
@@ -2,7 +2,7 @@ import { TileReader } from "./carto-spatial-tile.js";
|
|
|
2
2
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
3
3
|
import { getWorkerUrl } from "../../utils.js";
|
|
4
4
|
import { binaryToSpatialjson } from "./spatialjson-utils.js";
|
|
5
|
-
const VERSION = typeof "9.0.
|
|
5
|
+
const VERSION = typeof "9.0.32" !== 'undefined' ? "9.0.32" : 'latest';
|
|
6
6
|
const id = 'cartoSpatialTile';
|
|
7
7
|
const DEFAULT_OPTIONS = {
|
|
8
8
|
cartoSpatialTile: {
|
|
@@ -2,7 +2,7 @@ import earcut from 'earcut';
|
|
|
2
2
|
import { TileReader } from "./carto-tile.js";
|
|
3
3
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
4
4
|
import { getWorkerUrl } from "../../utils.js";
|
|
5
|
-
const VERSION = typeof "9.0.
|
|
5
|
+
const VERSION = typeof "9.0.32" !== 'undefined' ? "9.0.32" : 'latest';
|
|
6
6
|
const id = 'cartoVectorTile';
|
|
7
7
|
const DEFAULT_OPTIONS = {
|
|
8
8
|
cartoVectorTile: {
|
|
@@ -10,9 +10,7 @@ function isFeatureIdDefined(value) {
|
|
|
10
10
|
const defaultProps = {
|
|
11
11
|
tileSize: DEFAULT_TILE_SIZE
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
static { this.layerName = 'SpatialIndexTileLayer'; }
|
|
15
|
-
static { this.defaultProps = defaultProps; }
|
|
13
|
+
class SpatialIndexTileLayer extends TileLayer {
|
|
16
14
|
_updateAutoHighlight(info) {
|
|
17
15
|
const { hoveredFeatureId } = this.state;
|
|
18
16
|
const hoveredFeature = info.object;
|
|
@@ -65,3 +63,6 @@ export default class SpatialIndexTileLayer extends TileLayer {
|
|
|
65
63
|
return featureIndex[KEY] === tile.index[KEY];
|
|
66
64
|
}
|
|
67
65
|
}
|
|
66
|
+
SpatialIndexTileLayer.layerName = 'SpatialIndexTileLayer';
|
|
67
|
+
SpatialIndexTileLayer.defaultProps = defaultProps;
|
|
68
|
+
export default SpatialIndexTileLayer;
|
|
@@ -14,9 +14,7 @@ const defaultProps = {
|
|
|
14
14
|
tileSize: DEFAULT_TILE_SIZE
|
|
15
15
|
};
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
|
|
18
|
-
static { this.layerName = 'VectorTileLayer'; }
|
|
19
|
-
static { this.defaultProps = defaultProps; }
|
|
17
|
+
class VectorTileLayer extends MVTLayer {
|
|
20
18
|
constructor(...propObjects) {
|
|
21
19
|
// Force externally visible props type, as it is not possible modify via extension
|
|
22
20
|
// @ts-ignore
|
|
@@ -117,3 +115,6 @@ export default class VectorTileLayer extends MVTLayer {
|
|
|
117
115
|
return true;
|
|
118
116
|
}
|
|
119
117
|
}
|
|
118
|
+
VectorTileLayer.layerName = 'VectorTileLayer';
|
|
119
|
+
VectorTileLayer.defaultProps = defaultProps;
|
|
120
|
+
export default VectorTileLayer;
|