Skip to content

Commit

Permalink
z improvements (visgl#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored and Lezhi Li committed May 31, 2017
1 parent 2c9e9e9 commit 12919e4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Ref: http://keepachangelog.com/en/0.3.0/

## Beta Releases

[TBD]
- FIX: Composite layers now pass `getPolygonOffset` prop to children
- FIX: `PolygonLayer` and `GeoJsonLayer` orders sublayers dynamicly for better blending behavior

### deck.gl v4.1.0-alpha.5

- NEW: `getPolygonOffset` prop of the base Layer class (#649)
Expand Down
14 changes: 11 additions & 3 deletions src/layers/core/geojson-layer/geojson-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class GeoJsonLayer extends CompositeLayer {
getLineWidth, getElevation, updateTriggers} = this.props;

// base layer props
const {opacity, pickable, visible} = this.props;
const {opacity, pickable, visible, getPolygonOffset} = this.props;

// viewport props
const {positionOrigin, projectionMode, modelMatrix} = this.props;
Expand All @@ -127,6 +127,7 @@ export default class GeoJsonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -151,6 +152,7 @@ export default class GeoJsonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand Down Expand Up @@ -178,6 +180,7 @@ export default class GeoJsonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -202,6 +205,7 @@ export default class GeoJsonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -221,6 +225,7 @@ export default class GeoJsonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -234,11 +239,14 @@ export default class GeoJsonLayer extends CompositeLayer {
});

return [
polygonFillLayer,
// If not extruded: flat fill layer is drawn below outlines
!extruded && polygonFillLayer,
polygonWireframeLayer,
polygonLineLayer,
pathLayer,
pointLayer
pointLayer,
// If extruded: draw fill layer last for correct blending behavior
extruded && polygonFillLayer
].filter(Boolean);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/layers/core/grid-layer/grid-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class GridLayer extends CompositeLayer {
const {id, elevationScale, fp64, extruded, cellSize, coverage, lightSettings} = this.props;

// base layer props
const {opacity, pickable, visible} = this.props;
const {opacity, pickable, visible, getPolygonOffset} = this.props;

// viewport props
const {positionOrigin, projectionMode, modelMatrix} = this.props;
Expand All @@ -187,6 +187,7 @@ export default class GridLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand Down
3 changes: 2 additions & 1 deletion src/layers/core/hexagon-layer/hexagon-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default class HexagonLayer extends CompositeLayer {
const {id, radius, elevationScale, extruded, coverage, lightSettings, fp64} = this.props;

// base layer props
const {opacity, pickable, visible} = this.props;
const {opacity, pickable, visible, getPolygonOffset} = this.props;

// viewport props
const {positionOrigin, projectionMode, modelMatrix} = this.props;
Expand All @@ -227,6 +227,7 @@ export default class HexagonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand Down
12 changes: 9 additions & 3 deletions src/layers/core/polygon-layer/polygon-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class PolygonLayer extends CompositeLayer {
getPolygon, updateTriggers, lightSettings} = this.props;

// base layer props
const {opacity, pickable, visible} = this.props;
const {opacity, pickable, visible, getPolygonOffset} = this.props;

// viewport props
const {positionOrigin, projectionMode, modelMatrix} = this.props;
Expand All @@ -120,6 +120,7 @@ export default class PolygonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -145,6 +146,7 @@ export default class PolygonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand Down Expand Up @@ -173,6 +175,7 @@ export default class PolygonLayer extends CompositeLayer {
opacity,
pickable,
visible,
getPolygonOffset,
projectionMode,
positionOrigin,
modelMatrix,
Expand All @@ -186,9 +189,12 @@ export default class PolygonLayer extends CompositeLayer {
});

return [
polygonLayer,
// If not extruded: flat fill layer is drawn below outlines
!extruded && polygonLayer,
polygonWireframeLayer,
polygonLineLayer
polygonLineLayer,
// If extruded: draw fill layer last for correct blending behavior
extruded && polygonLayer
].filter(Boolean);
}
}
Expand Down

0 comments on commit 12919e4

Please sign in to comment.