Skip to content

Commit

Permalink
merge if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Mar 14, 2024
1 parent 00962c6 commit 168380c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/MapMaplibreGl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export default class MapMaplibreGl extends React.Component<MapMaplibreGlProps, M
// the necessary operations ourselves!
// We also need to update the style for inspect to work properly
map.setStyle(styleWithTokens, {diff: true});
map.showTileBoundaries = this.props.options?.showTileBoundaries!;
map.showCollisionBoxes = this.props.options?.showCollisionBoxes!;
map.showOverdrawInspector = this.props.options?.showOverdrawInspector!;
}

if(this.state.inspect && this.props.inspectModeEnabled !== this.state.inspect._showInspectMap) {
Expand All @@ -122,11 +125,6 @@ export default class MapMaplibreGl extends React.Component<MapMaplibreGlProps, M
this.state.inspect!.render();
}, 500);
}
if (map) {
map.showTileBoundaries = this.props.options?.showTileBoundaries!;
map.showCollisionBoxes = this.props.options?.showCollisionBoxes!;
map.showOverdrawInspector = this.props.options?.showOverdrawInspector!;
}
}

componentDidMount() {
Expand Down

0 comments on commit 168380c

Please sign in to comment.