Merge pull request #585 from orangemug/fix/issue-403

Update map style even if inspectModeEnabled=true
This commit is contained in:
pathmapper 2019-10-28 06:38:49 +01:00 committed by GitHub
commit 0196ba4eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,12 +87,10 @@ export default class MapboxGlMap extends React.Component {
const metadata = props.mapStyle.metadata || {}
MapboxGl.accessToken = metadata['maputnik:mapbox_access_token'] || tokens.mapbox
if(!props.inspectModeEnabled) {
//Mapbox GL now does diffing natively so we don't need to calculate
//the necessary operations ourselves!
this.state.map.setStyle(props.mapStyle, {diff: true})
}
}
componentDidUpdate(prevProps) {
if(!IS_SUPPORTED) return;