Skip to content

Commit

Permalink
Fix point_color_mode value to be uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
twojtasz committed Dec 10, 2019
1 parent a5a9198 commit 1064f2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/get-started/src/constants.js
Expand Up @@ -50,5 +50,5 @@ export const APP_SETTINGS = {

export const XVIZ_STYLE = {
'/tracklets/objects': [{name: 'selected', style: {fill_color: '#ff8000aa'}}],
'/lidar/points': [{style: {point_color_mode: 'elevation'}}]
'/lidar/points': [{style: {point_color_mode: 'ELEVATION'}}]
};
2 changes: 1 addition & 1 deletion examples/xviz-playground/src/code-samples.js
Expand Up @@ -54,7 +54,7 @@ const streamMetadata = {
.type('POINTS')
.coordinate('VEHICLE_RELATIVE')
.streamStyle({
point_color_mode: 'elevation',
point_color_mode: 'ELEVATION',
point_color_domain: [0, 3],
radius_pixels: 4
})
Expand Down
11 changes: 9 additions & 2 deletions modules/core/src/layers/point-cloud-layer/point-cloud-layer.js
Expand Up @@ -22,17 +22,24 @@ import {PointCloudLayer as CorePointCloudLayer} from '@deck.gl/layers';

import vs from './point-cloud-layer-vertex.glsl';

// Both cases are for backwards compatibility
/* eslint-disable camelcase */
const COLOR_MODE = {
default: 0,
elevation: 1,
distance_to_vehicle: 2
distance_to_vehicle: 2,
DEFAULT: 0,
ELEVATION: 1,
DISTANCE_TO_VEHICLE: 2
};

const COLOR_DOMAIN = {
default: [0, 0],
elevation: [0, 3],
distance_to_vehicle: [0, 60]
distance_to_vehicle: [0, 60],
DEFAULT: [0, 0],
ELEVATION: [0, 3],
DISTANCE_TO_VEHICLE: [0, 60]
};
/* eslint-enable camelcase */

Expand Down
2 changes: 1 addition & 1 deletion test/apps/viewer/src/constants.js
Expand Up @@ -54,7 +54,7 @@ export const APP_SETTINGS = {

export const XVIZ_STYLE = {
'/tracklets/objects': [{name: 'selected', style: {fill_color: '#ff8000aa'}}],
'/lidar/points': [{style: {point_color_mode: 'elevation'}}]
'/lidar/points': [{style: {point_color_mode: 'ELEVATION'}}]
};

export const STYLES = {
Expand Down

0 comments on commit 1064f2f

Please sign in to comment.