Skip to content

Commit

Permalink
Fixes for updateTriggers, new alpha version (visgl#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgios-uber authored Nov 16, 2017
1 parent 301fb26 commit cb6a7fe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ For Earlier Beta Releases see below

### deck.gl v4.2 Beta Releases

#### [4.2.0-alpha.22] - Nov 15
- Fixes for updateTriggers

#### [4.2.0-alpha.21] - Nov 15
- Fix bug in layer.js
- Create and use getSubLayerProps()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "deck.gl",
"description": "A suite of 3D-enabled data visualization overlays, suitable for react-map-gl",
"license": "MIT",
"version": "4.2.0-alpha.21",
"version": "4.2.0-alpha.22",
"keywords": [
"webgl",
"visualization",
Expand Down
7 changes: 6 additions & 1 deletion src/core-layers/path-layer/path-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ export default class PathLayer extends Layer {
}
this.updateAttribute({props, oldProps, changeFlags});

if (changeFlags.dataChanged) {
const geometryChanged = changeFlags.dataChanged ||
(changeFlags.updateTriggersChanged && (
changeFlags.updateTriggersChanged.all ||
changeFlags.updateTriggersChanged.getPath));

if (geometryChanged) {
// this.state.paths only stores point positions in each path
const paths = props.data.map(getPath);
const numInstances = paths.reduce((count, path) => count + path.length - 1, 0);
Expand Down
7 changes: 6 additions & 1 deletion src/core-layers/polygon-layer/polygon-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export default class PolygonLayer extends CompositeLayer {
}

updateState({oldProps, props, changeFlags}) {
if (changeFlags.dataChanged) {
const geometryChanged = changeFlags.dataChanged ||
(changeFlags.updateTriggersChanged && (
changeFlags.updateTriggersChanged.all ||
changeFlags.updateTriggersChanged.getPolygon));

if (geometryChanged) {
const {data, getPolygon} = this.props;
this.state.paths = [];
data.forEach(object => {
Expand Down
5 changes: 4 additions & 1 deletion src/core-layers/solid-polygon-layer/solid-polygon-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ export default class SolidPolygonLayer extends Layer {

updateGeometry({props, oldProps, changeFlags}) {
const geometryConfigChanged = props.extruded !== oldProps.extruded ||
props.wireframe !== oldProps.wireframe || props.fp64 !== oldProps.fp64;
props.wireframe !== oldProps.wireframe || props.fp64 !== oldProps.fp64 ||
(changeFlags.updateTriggersChanged && (
changeFlags.updateTriggersChanged.all ||
changeFlags.updateTriggersChanged.getPolygon));

// check if updateTriggers.getElevation has been triggered
const getElevationTriggered = changeFlags.updateTriggersChanged &&
Expand Down

0 comments on commit cb6a7fe

Please sign in to comment.