mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 09:15:29 +01:00
Propagate filter changes
This commit is contained in:
parent
a981a39691
commit
3c3f396937
1 changed files with 7 additions and 1 deletions
|
@ -82,6 +82,12 @@ export class LayerEditor extends React.Component {
|
|||
this.props.onLayerChanged(changedLayer)
|
||||
}
|
||||
|
||||
onFilterChanged(newValue) {
|
||||
let layer = this.props.layer
|
||||
const changedLayer = layer.set('filter', newValue)
|
||||
this.props.onLayerChanged(changedLayer)
|
||||
}
|
||||
|
||||
layerFromType(type) {
|
||||
if (type === "fill") {
|
||||
return <FillLayer
|
||||
|
@ -149,7 +155,7 @@ export class LayerEditor extends React.Component {
|
|||
</Toolbar>
|
||||
<FilterEditor
|
||||
filter={this.props.layer.get('filter', Immutable.List()).toJSON()}
|
||||
onChange={f => console.log('filter changed', f)}
|
||||
onChange={f => this.onFilterChanged(Immutable.fromJS(f))}
|
||||
/>
|
||||
{this.props.layer.get('type') !== 'background' && <SourceEditor
|
||||
source={this.props.layer.get('source')}
|
||||
|
|
Loading…
Reference in a new issue