@carto/kepler.gl 0.0.31-alpha.0 → 0.0.32-alpha1
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/constants/default-settings.js +2 -2
- package/dist/layers/base-layer.js +11 -32
- package/dist/layers/geojson-layer/geojson-layer.js +5 -7
- package/dist/layers/icon-layer/icon-layer.js +5 -8
- package/dist/layers/layer-factory.js +2 -2
- package/dist/layers/layer-text-label.js +3 -3
- package/dist/layers/point-layer/point-layer.js +3 -5
- package/dist/layers/trip-layer/trip-layer.js +2 -3
- package/dist/reducers/vis-state-merger.js +4 -4
- package/package.json +1 -1
- package/src/layers/base-layer.js +7 -27
- package/src/layers/geojson-layer/geojson-layer.js +4 -7
- package/src/layers/icon-layer/icon-layer.js +3 -11
- package/src/layers/layer-factory.js +1 -1
- package/src/layers/layer-text-label.js +2 -2
- package/src/layers/point-layer/point-layer.js +2 -9
- package/src/layers/trip-layer/trip-layer.js +1 -2
- package/src/reducers/vis-state-merger.js +3 -3
- package/umd/keplergl.min.js +8 -8
|
@@ -247,14 +247,11 @@ export default class IconLayer extends Layer {
|
|
|
247
247
|
renderLayer(opts) {
|
|
248
248
|
const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts;
|
|
249
249
|
|
|
250
|
-
const
|
|
251
|
-
const radiusScale = this.getRadiusScale(fixedRadius);
|
|
252
|
-
const radiusUnits = this.getRadiusUnit(fixedRadius);
|
|
250
|
+
const radiusScale = this.getRadiusScaleByZoom(mapState);
|
|
253
251
|
|
|
254
252
|
const layerProps = {
|
|
255
253
|
radiusScale,
|
|
256
|
-
|
|
257
|
-
...(fixedRadius ? {} : {radiusMaxPixels: 500})
|
|
254
|
+
...(this.config.visConfig.fixedRadius ? {} : {radiusMaxPixels: 500})
|
|
258
255
|
};
|
|
259
256
|
|
|
260
257
|
const updateTriggers = {
|
|
@@ -265,12 +262,7 @@ export default class IconLayer extends Layer {
|
|
|
265
262
|
|
|
266
263
|
const defaultLayerProps = this.getDefaultDeckLayerProps(opts);
|
|
267
264
|
const brushingProps = this.getBrushingExtensionProps(interactionConfig);
|
|
268
|
-
const getPixelOffset = getTextOffsetByRadius(
|
|
269
|
-
radiusScale,
|
|
270
|
-
data.getRadius,
|
|
271
|
-
mapState,
|
|
272
|
-
fixedRadius
|
|
273
|
-
);
|
|
265
|
+
const getPixelOffset = getTextOffsetByRadius(radiusScale, data.getRadius, mapState);
|
|
274
266
|
const extensions = [...defaultLayerProps.extensions, brushingExtension];
|
|
275
267
|
|
|
276
268
|
// shared Props between layer and label layer
|
|
@@ -24,7 +24,7 @@ import uniq from 'lodash.uniq';
|
|
|
24
24
|
|
|
25
25
|
export const defaultPadding = 20;
|
|
26
26
|
|
|
27
|
-
export function getTextOffsetByRadius(radiusScale, getRadius, mapState
|
|
27
|
+
export function getTextOffsetByRadius(radiusScale, getRadius, mapState) {
|
|
28
28
|
return textLabel => {
|
|
29
29
|
const distanceScale = getDistanceScales(mapState);
|
|
30
30
|
const xMult = textLabel.anchor === 'middle' ? 0 : textLabel.anchor === 'start' ? 1 : -1;
|
|
@@ -37,7 +37,7 @@ export function getTextOffsetByRadius(radiusScale, getRadius, mapState, fixedRad
|
|
|
37
37
|
? textLabel.size
|
|
38
38
|
: textLabel.size;
|
|
39
39
|
|
|
40
|
-
const pixelRadius =
|
|
40
|
+
const pixelRadius = radiusScale * distanceScale.pixelsPerMeter[0];
|
|
41
41
|
const padding = defaultPadding;
|
|
42
42
|
|
|
43
43
|
return typeof getRadius === 'function'
|
|
@@ -242,8 +242,7 @@ export default class PointLayer extends Layer {
|
|
|
242
242
|
|
|
243
243
|
// if no field size is defined we need to pass fixed radius = false
|
|
244
244
|
const fixedRadius = this.config.visConfig.fixedRadius && Boolean(this.config.sizeField);
|
|
245
|
-
const radiusScale = this.
|
|
246
|
-
const radiusUnits = this.getRadiusUnit(fixedRadius);
|
|
245
|
+
const radiusScale = this.getRadiusScaleByZoom(mapState, fixedRadius);
|
|
247
246
|
|
|
248
247
|
const layerProps = {
|
|
249
248
|
stroked: this.config.visConfig.outline,
|
|
@@ -261,12 +260,7 @@ export default class PointLayer extends Layer {
|
|
|
261
260
|
|
|
262
261
|
const defaultLayerProps = this.getDefaultDeckLayerProps(opts);
|
|
263
262
|
const brushingProps = this.getBrushingExtensionProps(interactionConfig);
|
|
264
|
-
const getPixelOffset = getTextOffsetByRadius(
|
|
265
|
-
radiusScale,
|
|
266
|
-
data.getRadius,
|
|
267
|
-
mapState,
|
|
268
|
-
fixedRadius
|
|
269
|
-
);
|
|
263
|
+
const getPixelOffset = getTextOffsetByRadius(radiusScale, data.getRadius, mapState);
|
|
270
264
|
const extensions = [...defaultLayerProps.extensions, brushingExtension];
|
|
271
265
|
|
|
272
266
|
const sharedProps = {
|
|
@@ -288,7 +282,6 @@ export default class PointLayer extends Layer {
|
|
|
288
282
|
// circles will be flat on the map when the altitude column is not used
|
|
289
283
|
depthTest: this.config.columns.altitude?.fieldIdx > -1
|
|
290
284
|
},
|
|
291
|
-
radiusUnits,
|
|
292
285
|
lineWidthUnits: 'pixels',
|
|
293
286
|
updateTriggers,
|
|
294
287
|
extensions
|
|
@@ -278,8 +278,7 @@ export default class TripLayer extends Layer {
|
|
|
278
278
|
...defaultLayerProps,
|
|
279
279
|
...data,
|
|
280
280
|
getTimestamps: d => data.getTimestamps(d).map(ts => ts - domain0),
|
|
281
|
-
widthScale: this.config.visConfig.thickness,
|
|
282
|
-
widthUnits: 'pixels',
|
|
281
|
+
widthScale: this.config.visConfig.thickness * zoomFactor * zoomFactorValue,
|
|
283
282
|
rounded: true,
|
|
284
283
|
wrapLongitude: false,
|
|
285
284
|
parameters: {
|
|
@@ -146,9 +146,9 @@ export function insertLayerAtRightOrder(
|
|
|
146
146
|
if (expectedIdx > 0) {
|
|
147
147
|
// look for layer to insert after
|
|
148
148
|
let i = expectedIdx + 1;
|
|
149
|
-
let preceedIdx =
|
|
150
|
-
while (i-- > 0 && preceedIdx ===
|
|
151
|
-
const preceedLayer = preservedOrder[
|
|
149
|
+
let preceedIdx = -1;
|
|
150
|
+
while (i-- > 0 && preceedIdx === -1) {
|
|
151
|
+
const preceedLayer = preservedOrder[i];
|
|
152
152
|
preceedIdx = layerOrderQueue.indexOf(preceedLayer);
|
|
153
153
|
}
|
|
154
154
|
|