mirror of
https://github.com/maputnik/editor.git
synced 2026-01-05 21:10:02 +00:00
Use Mapbox GL Inspect
This commit is contained in:
@@ -84,6 +84,7 @@ export default class Toolbar extends React.Component {
|
||||
onStyleDownload: React.PropTypes.func.isRequired,
|
||||
// A dict of source id's and the available source layers
|
||||
sources: React.PropTypes.object.isRequired,
|
||||
onInspectModeToggle: React.PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@@ -105,23 +106,6 @@ export default class Toolbar extends React.Component {
|
||||
</ToolbarAction>
|
||||
}
|
||||
|
||||
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: {
|
||||
...this.props.mapStyle.metadata,
|
||||
'maputnik:renderer': changedRenderer
|
||||
}
|
||||
}
|
||||
|
||||
this.props.onStyleChanged(changedStyle)
|
||||
}
|
||||
|
||||
toggleModal(modalName) {
|
||||
this.setState({
|
||||
isOpen: {
|
||||
@@ -194,7 +178,7 @@ export default class Toolbar extends React.Component {
|
||||
<SettingsIcon />
|
||||
<IconText>Style Settings</IconText>
|
||||
</ToolbarAction>
|
||||
<ToolbarAction onClick={this.toggleInspectionMode.bind(this)}>
|
||||
<ToolbarAction onClick={this.props.onInspectModeToggle}>
|
||||
<InspectionIcon />
|
||||
<IconText>Inspect</IconText>
|
||||
</ToolbarAction>
|
||||
|
||||
Reference in New Issue
Block a user