Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Fix within expression serialization + fix within expression equal ope…
Browse files Browse the repository at this point in the history
…rator
  • Loading branch information
zmiao committed Mar 4, 2020
1 parent 3c499cd commit 277199e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mbgl/style/expression/within.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ Value valueConverter(const mapbox::geojson::rapidjson_value& v) {
}
return result;
}
if (v.IsObject()) {
std::unordered_map<std::string, Value> 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;
}
Expand All @@ -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<const Within*>(&e);
return geoJSONSource == rhs->geoJSONSource;
return geoJSONSource == rhs->geoJSONSource && geometries == rhs->geometries && polygonBBox == rhs->polygonBBox;
}
return false;
}
Expand Down

0 comments on commit 277199e

Please sign in to comment.