diff options
author | Dane Springmeyer <dane@mapbox.com> | 2017-10-17 18:32:11 -0700 |
---|---|---|
committer | Dane Springmeyer <dane@mapbox.com> | 2017-10-17 18:32:11 -0700 |
commit | 2c01c867e64304164ed12e0159d86e22fc103d76 (patch) | |
tree | a4c445d9c8882df06e5e4a01121c826a63fd1c3b /src | |
parent | 10f7af19ce1ec61f37459f9cd75e2a0c89a0c790 (diff) | |
download | qtlocation-mapboxgl-upstream/mapbox-feature.tar.gz |
adapt to decoupled mapbox::featureupstream/mapbox-feature
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/annotation/shape_annotation_impl.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.cpp | 12 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/tile/geojson_tile.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/tile/geojson_tile.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/tile/geojson_tile_data.hpp | 16 |
7 files changed, 23 insertions, 21 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index 0c1a631ad8..b70e75cca1 100644 --- a/src/mbgl/annotation/shape_annotation_impl.cpp +++ b/src/mbgl/annotation/shape_annotation_impl.cpp @@ -6,6 +6,7 @@ #include <mbgl/util/string.hpp> #include <mbgl/util/constants.hpp> #include <mbgl/util/geometry.hpp> +#include <mbgl/util/feature.hpp> namespace mbgl { @@ -22,7 +23,7 @@ void ShapeAnnotationImpl::updateTileData(const CanonicalTileID& tileID, Annotati static const double baseTolerance = 4; if (!shapeTiler) { - mapbox::geometry::feature_collection<double> features; + mbgl::FeatureCollection features; features.emplace_back(ShapeAnnotationGeometry::visit(geometry(), [] (auto&& geom) { return Feature { std::move(geom) }; })); diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp index 4e3478322d..0cd5c2bbff 100644 --- a/src/mbgl/style/sources/geojson_source.cpp +++ b/src/mbgl/style/sources/geojson_source.cpp @@ -67,7 +67,7 @@ void GeoJSONSource::loadDescription(FileSource& fileSource) { error.message.c_str()); // Create an empty GeoJSON VT object to make sure we're not infinitely waiting for // tiles to load. - baseImpl = makeMutable<Impl>(impl(), GeoJSON{ FeatureCollection{} }); + baseImpl = makeMutable<Impl>(impl(), GeoJSON{ GeoJSONFeatureCollection{} }); } else { baseImpl = makeMutable<Impl>(impl(), *geoJSON); } diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp index fd6d7d3013..e652826e41 100644 --- a/src/mbgl/style/sources/geojson_source_impl.cpp +++ b/src/mbgl/style/sources/geojson_source_impl.cpp @@ -17,7 +17,7 @@ public: const mapbox::geojsonvt::Options& options) : impl(geoJSON, options) {} - mapbox::geometry::feature_collection<int16_t> getTile(const CanonicalTileID& tileID) final { + mapbox::feature::feature_collection<int16_t> getTile(const CanonicalTileID& tileID) final { return impl.getTile(tileID.z, tileID.x, tileID.y).features; } @@ -27,11 +27,11 @@ private: class SuperclusterData : public GeoJSONData { public: - SuperclusterData(const mapbox::geometry::feature_collection<double>& features, + SuperclusterData(const mapbox::feature::feature_collection<double>& features, const mapbox::supercluster::Options& options) : impl(features, options) {} - mapbox::geometry::feature_collection<int16_t> getTile(const CanonicalTileID& tileID) final { + mapbox::feature::feature_collection<int16_t> getTile(const CanonicalTileID& tileID) final { return impl.getTile(tileID.z, tileID.x, tileID.y); } @@ -50,14 +50,14 @@ GeoJSONSource::Impl::Impl(const Impl& other, const GeoJSON& geoJSON) double scale = util::EXTENT / util::tileSize; if (options.cluster - && geoJSON.is<mapbox::geometry::feature_collection<double>>() - && !geoJSON.get<mapbox::geometry::feature_collection<double>>().empty()) { + && geoJSON.is<mapbox::feature::feature_collection<double>>() + && !geoJSON.get<mapbox::feature::feature_collection<double>>().empty()) { mapbox::supercluster::Options clusterOptions; clusterOptions.maxZoom = options.clusterMaxZoom; clusterOptions.extent = util::EXTENT; clusterOptions.radius = ::round(scale * options.clusterRadius); data = std::make_unique<SuperclusterData>( - geoJSON.get<mapbox::geometry::feature_collection<double>>(), clusterOptions); + geoJSON.get<mapbox::feature::feature_collection<double>>(), clusterOptions); } else { mapbox::geojsonvt::Options vtOptions; vtOptions.maxZoom = options.maxzoom; diff --git a/src/mbgl/style/sources/geojson_source_impl.hpp b/src/mbgl/style/sources/geojson_source_impl.hpp index a524bab9f2..8922c074b0 100644 --- a/src/mbgl/style/sources/geojson_source_impl.hpp +++ b/src/mbgl/style/sources/geojson_source_impl.hpp @@ -3,6 +3,7 @@ #include <mbgl/style/source_impl.hpp> #include <mbgl/style/sources/geojson_source.hpp> #include <mbgl/util/range.hpp> +#include <mapbox/feature.hpp> namespace mbgl { @@ -14,7 +15,7 @@ namespace style { class GeoJSONData { public: virtual ~GeoJSONData() = default; - virtual mapbox::geometry::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0; + virtual mapbox::feature::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0; }; class GeoJSONSource::Impl : public Source::Impl { diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp index d648d2e5ff..356fe678e0 100644 --- a/src/mbgl/tile/geojson_tile.cpp +++ b/src/mbgl/tile/geojson_tile.cpp @@ -9,12 +9,12 @@ namespace mbgl { GeoJSONTile::GeoJSONTile(const OverscaledTileID& overscaledTileID, std::string sourceID_, const TileParameters& parameters, - mapbox::geometry::feature_collection<int16_t> features) + mapbox::feature::feature_collection<int16_t> features) : GeometryTile(overscaledTileID, sourceID_, parameters) { updateData(std::move(features)); } -void GeoJSONTile::updateData(mapbox::geometry::feature_collection<int16_t> features) { +void GeoJSONTile::updateData(mapbox::feature::feature_collection<int16_t> features) { setData(std::make_unique<GeoJSONTileData>(std::move(features))); } diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp index 270406267c..2fa1ac47f4 100644 --- a/src/mbgl/tile/geojson_tile.hpp +++ b/src/mbgl/tile/geojson_tile.hpp @@ -12,9 +12,9 @@ public: GeoJSONTile(const OverscaledTileID&, std::string sourceID, const TileParameters&, - mapbox::geometry::feature_collection<int16_t>); + mapbox::feature::feature_collection<int16_t>); - void updateData(mapbox::geometry::feature_collection<int16_t>); + void updateData(mapbox::feature::feature_collection<int16_t>); void querySourceFeatures( std::vector<Feature>& result, diff --git a/src/mbgl/tile/geojson_tile_data.hpp b/src/mbgl/tile/geojson_tile_data.hpp index 3402c2a009..6bd76eb70d 100644 --- a/src/mbgl/tile/geojson_tile_data.hpp +++ b/src/mbgl/tile/geojson_tile_data.hpp @@ -7,9 +7,9 @@ namespace mbgl { class GeoJSONTileFeature : public GeometryTileFeature { public: - const mapbox::geometry::feature<int16_t>& feature; + const mapbox::feature::feature<int16_t>& feature; - GeoJSONTileFeature(const mapbox::geometry::feature<int16_t>& feature_) + GeoJSONTileFeature(const mapbox::feature::feature<int16_t>& feature_) : feature(feature_) { } @@ -47,7 +47,7 @@ public: class GeoJSONTileLayer : public GeometryTileLayer { public: - GeoJSONTileLayer(std::shared_ptr<const mapbox::geometry::feature_collection<int16_t>> features_) + GeoJSONTileLayer(std::shared_ptr<const mapbox::feature::feature_collection<int16_t>> features_) : features(std::move(features_)) { } @@ -64,17 +64,17 @@ public: } private: - std::shared_ptr<const mapbox::geometry::feature_collection<int16_t>> features; + std::shared_ptr<const mapbox::feature::feature_collection<int16_t>> features; }; class GeoJSONTileData : public GeometryTileData { public: - GeoJSONTileData(mapbox::geometry::feature_collection<int16_t> features_) - : features(std::make_shared<mapbox::geometry::feature_collection<int16_t>>( + GeoJSONTileData(mapbox::feature::feature_collection<int16_t> features_) + : features(std::make_shared<mapbox::feature::feature_collection<int16_t>>( std::move(features_))) { } - GeoJSONTileData(std::shared_ptr<const mapbox::geometry::feature_collection<int16_t>> features_) + GeoJSONTileData(std::shared_ptr<const mapbox::feature::feature_collection<int16_t>> features_) : features(std::move(features_)) { } @@ -88,7 +88,7 @@ public: private: - std::shared_ptr<const mapbox::geometry::feature_collection<int16_t>> features; + std::shared_ptr<const mapbox::feature::feature_collection<int16_t>> features; }; } // namespace mbgl |