mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-03-21 22:21:08 +01:00
Notice for not supported nested filter
This commit is contained in:
parent
03796c963b
commit
e7709dae15
1 changed files with 17 additions and 0 deletions
|
@ -11,6 +11,18 @@ const otherFilterOps = Object
|
||||||
.keys(GlSpec.filter_operator.values)
|
.keys(GlSpec.filter_operator.values)
|
||||||
.filter(op => combiningFilterOps.indexOf(op) < 0)
|
.filter(op => combiningFilterOps.indexOf(op) < 0)
|
||||||
|
|
||||||
|
function hasCombiningFilter(filter) {
|
||||||
|
return combiningFilterOps.indexOf(filter[0]) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasNestedCombiningFilter(filter) {
|
||||||
|
if(hasCombiningFilter(filter)) {
|
||||||
|
const combinedFilters = filter.slice(1)
|
||||||
|
return filter.slice(1).map(f => hasCombiningFilter(f)).filter(f => f == true).length > 0
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
class CombiningOperatorSelect extends React.Component {
|
class CombiningOperatorSelect extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
value: React.PropTypes.string.isRequired,
|
value: React.PropTypes.string.isRequired,
|
||||||
|
@ -165,6 +177,11 @@ export default class CombiningFilterEditor extends React.Component {
|
||||||
/>
|
/>
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//TODO: Implement support for nested filter
|
||||||
|
if(hasNestedCombiningFilter(filter)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return <div style={{
|
return <div style={{
|
||||||
padding: margins[2],
|
padding: margins[2],
|
||||||
paddingRight: 0,
|
paddingRight: 0,
|
||||||
|
|
Loading…
Add table
Reference in a new issue