Keep inspect mode consistent across renderer changes

If you were in inspect mode, switched to open layers, and back to
MapboxGlMap, the state in MapboxGlMap and MapboxInspect diverged,
meaning MapboxGlMap thought it was in inspect mode, while MapboxInspect
had inspector mode disabled.
This commit is contained in:
Alexander Clausen 2019-01-06 06:02:10 +01:00
parent 1375240bfa
commit 6cf861d44e

View file

@ -174,6 +174,9 @@ export default class MapboxGlMap extends React.Component {
map.on("style.load", () => {
this.setState({ map, inspect });
if(this.props.inspectModeEnabled) {
inspect.toggleInspector();
}
})
map.on("data", e => {