Skip to content

Commit

Permalink
fix: [lyftga] pass the latest deckgl props (apache#7208)
Browse files Browse the repository at this point in the history
  • Loading branch information
khtruong authored and xtinec committed Apr 3, 2019
1 parent 74a0b57 commit 200efac
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,25 @@ const propTypes = {
disabled: PropTypes.bool,
viewport: PropTypes.object.isRequired,
children: PropTypes.node,
mapStyle: PropTypes.string,
mapboxApiAccessToken: PropTypes.string.isRequired,
setControlValue: PropTypes.func,
onViewportChange: PropTypes.func,
onValuesChange: PropTypes.func,
};

const defaultProps = {
aggregation: false,
disabled: false,
mapStyle: 'light',
setControlValue: () => {},
onViewportChange: () => {},
onValuesChange: () => {},
};

export default class AnimatableDeckGLContainer extends React.Component {
constructor(props) {
super(props);
const { getLayers, start, end, getStep, values, disabled, viewport, ...other } = props;
this.other = other;

this.onViewportChange = this.onViewportChange.bind(this);
}
onViewportChange(viewport) {
Expand All @@ -71,6 +73,9 @@ export default class AnimatableDeckGLContainer extends React.Component {
values,
onValuesChange,
viewport,
setControlValue,
mapStyle,
mapboxApiAccessToken,
} = this.props;
const layers = getLayers(values);

Expand All @@ -83,9 +88,11 @@ export default class AnimatableDeckGLContainer extends React.Component {
return (
<div>
<DeckGLContainer
{...this.other}
viewport={modifiedViewport}
layers={layers}
setControlValue={setControlValue}
mapStyle={mapStyle}
mapboxApiAccessToken={mapboxApiAccessToken}
onViewportChange={this.onViewportChange}
/>
{!disabled &&
Expand Down

0 comments on commit 200efac

Please sign in to comment.