diff --git a/src/mbgl/style/expression/within.cpp b/src/mbgl/style/expression/within.cpp index 9de5af39eb5..18b024fc405 100644 --- a/src/mbgl/style/expression/within.cpp +++ b/src/mbgl/style/expression/within.cpp @@ -233,6 +233,13 @@ Value valueConverter(const mapbox::geojson::rapidjson_value& v) { } return result; } + if (v.IsObject()) { + std::unordered_map result; + for (const auto& m : v.GetObject()) { + result.emplace(m.name.GetString(), valueConverter(m.value)); + } + return result; + } // Ignore other types as valid geojson only contains above types. return Null; } @@ -255,7 +262,7 @@ mbgl::Value Within::serialize() const { bool Within::operator==(const Expression& e) const { if (e.getKind() == Kind::Within) { auto rhs = static_cast(&e); - return geoJSONSource == rhs->geoJSONSource; + return geoJSONSource == rhs->geoJSONSource && geometries == rhs->geometries && polygonBBox == rhs->polygonBBox; } return false; }