From 6cf861d44e1f07eee9c58795100dde1acc0c6996 Mon Sep 17 00:00:00 2001 From: Alexander Clausen Date: Sun, 6 Jan 2019 06:02:10 +0100 Subject: [PATCH] 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. --- src/components/map/MapboxGlMap.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/map/MapboxGlMap.jsx b/src/components/map/MapboxGlMap.jsx index 0e2afa5..5765f84 100644 --- a/src/components/map/MapboxGlMap.jsx +++ b/src/components/map/MapboxGlMap.jsx @@ -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 => {