diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-16 10:15:37 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-17 13:20:25 -0700 |
commit | 7f6944f6176464afba5e9065ab1f36749332a17f (patch) | |
tree | ed50fcdbd2d4a75fa15ba7b7c7238c41c0ea63d3 /src | |
parent | fbb074a0890ccf5e82359f6c18e903c0c93b663d (diff) | |
download | qtlocation-mapboxgl-7f6944f6176464afba5e9065ab1f36749332a17f.tar.gz |
[core] Fix properties of GeoJSON layers in queryRenderedFeatures
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/tile/geojson_tile.cpp | 12 | ||||
-rw-r--r-- | src/mbgl/tile/geojson_tile.hpp | 7 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp index 9162cedf14..81d2cb5144 100644 --- a/src/mbgl/tile/geojson_tile.cpp +++ b/src/mbgl/tile/geojson_tile.cpp @@ -6,8 +6,8 @@ namespace mbgl { GeoJSONTileFeature::GeoJSONTileFeature(FeatureType type_, GeometryCollection&& geometries_, - GeoJSONTileFeature::Tags&& tags_) - : type(type_), geometries(std::move(geometries_)), tags(std::move(tags_)) { + Feature::property_map&& properties_) + : type(type_), geometries(std::move(geometries_)), properties(std::move(properties_)) { } FeatureType GeoJSONTileFeature::getType() const { @@ -15,8 +15,8 @@ FeatureType GeoJSONTileFeature::getType() const { } optional<Value> GeoJSONTileFeature::getValue(const std::string& key) const { - auto it = tags.find(key); - if (it != tags.end()) { + auto it = properties.find(key); + if (it != properties.end()) { return optional<Value>(it->second); } return optional<Value>(); @@ -89,10 +89,10 @@ std::unique_ptr<GeoJSONTile> convertTile(const mapbox::geojsonvt::Tile& tile) { } } - GeoJSONTileFeature::Tags tags{ feature.tags.begin(), feature.tags.end() }; + Feature::property_map properties { feature.tags.begin(), feature.tags.end() }; features.emplace_back(std::make_shared<GeoJSONTileFeature>( - featureType, std::move(geometry), std::move(tags))); + featureType, std::move(geometry), std::move(properties))); } layer = std::make_unique<GeoJSONTileLayer>(std::move(features)); diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp index 768f005482..6a490c39a2 100644 --- a/src/mbgl/tile/geojson_tile.hpp +++ b/src/mbgl/tile/geojson_tile.hpp @@ -19,17 +19,16 @@ namespace mbgl { class GeoJSONTileFeature : public GeometryTileFeature { public: - using Tags = std::unordered_map<std::string, std::string>; - - GeoJSONTileFeature(FeatureType, GeometryCollection&&, Tags&& = Tags{}); + GeoJSONTileFeature(FeatureType, GeometryCollection&&, Feature::property_map&&); FeatureType getType() const override; optional<Value> getValue(const std::string&) const override; + Feature::property_map getProperties() const override { return properties; } GeometryCollection getGeometries() const override; private: const FeatureType type; const GeometryCollection geometries; - const Tags tags; + const Feature::property_map properties; }; class GeoJSONTileLayer : public GeometryTileLayer { |