-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
We can likely use isExpressionFilter
at
vtshaver/lib/styleToFilters.js
Lines 82 to 112 in b0d8eb4
function getPropertyFromFilter(filter, properties) { | |
if (styleSpec.expression.isExpression(filter)) { | |
getPropertyFromExpression(filter, properties); | |
} | |
// Warning: Below code should put in to an else conditions, | |
// but since the `isExpression` can not tell it is a expression or filter syntax I put it outsied the else | |
// this could reduce the performance or cause some potential bugs, we must keep an eye on this. | |
// else { | |
let subFilter = []; | |
for (let i = 0; i < filter.length; i++) { | |
if (typeof filter[i] === 'object' && filter[i] instanceof Array) { | |
subFilter.push(filter[i]); | |
} | |
} | |
if (subFilter.length > 0) { | |
subFilter.forEach(sfilter => { | |
getPropertyFromFilter(sfilter, properties); | |
}) | |
} else { | |
if (filter.length >= 3 && typeof filter[1] === 'string') { | |
if (filter[1].indexOf('$') === -1) { | |
properties.push(filter[1]); | |
} | |
} | |
} | |
// } | |
} |
This is getting exposed at mapbox/mapbox-gl-js#9530
Metadata
Metadata
Assignees
Labels
No labels