mirror of
https://github.com/maputnik/editor.git
synced 2026-06-22 15:17:29 +00:00
Fix replacing of access tokens in MapboxGl.
This commit is contained in:
@@ -60,6 +60,7 @@ export default class MapboxGlMap extends React.Component {
|
|||||||
inspectModeEnabled: PropTypes.bool.isRequired,
|
inspectModeEnabled: PropTypes.bool.isRequired,
|
||||||
highlightedLayer: PropTypes.object,
|
highlightedLayer: PropTypes.object,
|
||||||
options: PropTypes.object,
|
options: PropTypes.object,
|
||||||
|
replaceAccessTokens: PropTypes.func.isRequired,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +91,10 @@ export default class MapboxGlMap extends React.Component {
|
|||||||
|
|
||||||
//Mapbox GL now does diffing natively so we don't need to calculate
|
//Mapbox GL now does diffing natively so we don't need to calculate
|
||||||
//the necessary operations ourselves!
|
//the necessary operations ourselves!
|
||||||
this.state.map.setStyle(props.mapStyle, {diff: true})
|
this.state.map.setStyle(
|
||||||
|
this.props.replaceAccessTokens(props.mapStyle),
|
||||||
|
{diff: true}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
|
|||||||
Reference in New Issue
Block a user