mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 01:55:28 +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)
|
this.props.onLayerChanged(changedLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onFilterChanged(newValue) {
|
||||||
|
let layer = this.props.layer
|
||||||
|
const changedLayer = layer.set('filter', newValue)
|
||||||
|
this.props.onLayerChanged(changedLayer)
|
||||||
|
}
|
||||||
|
|
||||||
layerFromType(type) {
|
layerFromType(type) {
|
||||||
if (type === "fill") {
|
if (type === "fill") {
|
||||||
return <FillLayer
|
return <FillLayer
|
||||||
|
@ -149,7 +155,7 @@ export class LayerEditor extends React.Component {
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
<FilterEditor
|
<FilterEditor
|
||||||
filter={this.props.layer.get('filter', Immutable.List()).toJSON()}
|
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
|
{this.props.layer.get('type') !== 'background' && <SourceEditor
|
||||||
source={this.props.layer.get('source')}
|
source={this.props.layer.get('source')}
|
||||||
|
|
Loading…
Reference in a new issue