diff --git a/src/components/Toolbar.jsx b/src/components/Toolbar.jsx index 996d966..369463b 100644 --- a/src/components/Toolbar.jsx +++ b/src/components/Toolbar.jsx @@ -99,6 +99,22 @@ export default class Toolbar extends React.Component { } + toggleInspectionMode() { + const metadata = this.props.mapStyle.metadata || {} + const currentRenderer = metadata['maputnik:renderer'] || 'mbgljs' + + const changedRenderer = currentRenderer === 'inspection' ? 'mbgljs' : 'inspection' + + const changedStyle = { + ...this.props.mapStyle, + metadata: { + 'maputnik:renderer': changedRenderer + } + } + + this.props.onStyleChanged(changedStyle) + } + toggleModal(modalName) { this.setState({ isOpen: { @@ -160,7 +176,7 @@ export default class Toolbar extends React.Component { Style Settings - + Inspect