diff options
author | kevin <kevin.li@mapbox.com> | 2020-03-04 14:26:00 +0800 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-11 21:53:12 +0200 |
commit | f98cf0cd4b5212678d35bf28bf087909dcbd0756 (patch) | |
tree | a096c9a83a967d118cf039ab74ffa02acee9217f /src/mbgl/style | |
parent | 901a96048755587fdd5d1332695d2021fc169591 (diff) | |
download | qtlocation-mapboxgl-f98cf0cd4b5212678d35bf28bf087909dcbd0756.tar.gz |
[core] Not filter express `in` in `filter`.
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/conversion/filter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/style/conversion/filter.cpp b/src/mbgl/style/conversion/filter.cpp index f3e7050ccc..0a10d1e80a 100644 --- a/src/mbgl/style/conversion/filter.cpp +++ b/src/mbgl/style/conversion/filter.cpp @@ -53,9 +53,14 @@ bool isExpression(const Convertible& filter) { optional<std::string> operand = toString(arrayMember(filter, 1)); return operand && *operand != "$id" && *operand != "$type"; - } else if (*op == "in" || *op == "!in" || *op == "!has" || *op == "none") { + } else if (*op == "!in" || *op == "!has" || *op == "none") { return false; + } else if (*op == "in") { + optional<std::string> str = toString(arrayMember(filter, 1)); + + return arrayLength(filter) >= 3 && (!str || isArray(arrayMember(filter, 2))); + } else if (*op == "==" || *op == "!=" || *op == ">" || *op == ">=" || *op == "<" || *op == "<=") { return arrayLength(filter) != 3 || isArray(arrayMember(filter, 1)) || isArray(arrayMember(filter, 2)); |