@carto/kepler.gl 0.0.31-alpha.0 → 0.0.31

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.
@@ -111,7 +111,7 @@ export const LAYER_VIS_CONFIGS = {
111
111
  // radius is actually radiusScale in deck.gl
112
112
  radius: {
113
113
  type: 'number',
114
- defaultValue: 2,
114
+ defaultValue: 10,
115
115
  label: 'layerVisConfigs.radius',
116
116
  isRanged: false,
117
117
  range: [0, 100],
@@ -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, fixedRadius) {
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 = fixedRadius ? radiusScale * distanceScale.pixelsPerMeter[0] : radiusScale;
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.getRadiusScale(fixedRadius);
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 = null;
150
- while (i-- > 0 && preceedIdx === null) {
151
- const preceedLayer = preservedOrder[expectedIdx - 1];
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