Load OL3 code only once we need it

This commit is contained in:
Lukas Martinelli
2016-12-22 18:08:42 +01:00
parent 607e920548
commit 3ee1473a49
8 changed files with 123 additions and 46 deletions

View File

@@ -23,8 +23,14 @@ class SettingsModal extends React.Component {
this.props.onStyleChanged(changedStyle)
}
onRendererChange(e) {
const changedStyle = this.props.mapStyle.setIn(['metadata', 'maputnik:renderer'], e.target.value)
onRendererChange(renderer) {
const changedStyle = {
...this.props.mapStyle,
metadata: {
...this.props.mapStyle.metadata,
'maputnik:renderer': renderer,
}
}
this.props.onStyleChanged(changedStyle)
}