diff options
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.cpp | 28 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.hpp | 7 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp index 1c1288d978..10fd7cacea 100644 --- a/src/mbgl/style/sources/geojson_source_impl.cpp +++ b/src/mbgl/style/sources/geojson_source_impl.cpp @@ -21,6 +21,20 @@ public: return impl.getTile(tileID.z, tileID.x, tileID.y).features; } + mapbox::feature::feature_collection<double> getChildren(const std::uint32_t) final { + return {}; + } + + mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t, + const std::uint32_t, + const std::uint32_t) final { + return {}; + } + + std::uint8_t getClusterExpansionZoom(std::uint32_t) final { + return 0; + } + private: mapbox::geojsonvt::GeoJSONVT impl; }; @@ -35,6 +49,20 @@ public: return impl.getTile(tileID.z, tileID.x, tileID.y); } + mapbox::feature::feature_collection<double> getChildren(const std::uint32_t cluster_id) final { + return impl.getChildren(cluster_id); + } + + mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t cluster_id, + const std::uint32_t limit, + const std::uint32_t offset) final { + return impl.getLeaves(cluster_id, limit, offset); + } + + std::uint8_t getClusterExpansionZoom(std::uint32_t cluster_id) final { + return impl.getClusterExpansionZoom(cluster_id); + } + private: mapbox::supercluster::Supercluster impl; }; diff --git a/src/mbgl/style/sources/geojson_source_impl.hpp b/src/mbgl/style/sources/geojson_source_impl.hpp index 957cf53081..9984bbdd62 100644 --- a/src/mbgl/style/sources/geojson_source_impl.hpp +++ b/src/mbgl/style/sources/geojson_source_impl.hpp @@ -15,6 +15,13 @@ class GeoJSONData { public: virtual ~GeoJSONData() = default; virtual mapbox::feature::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0; + + // SuperclusterData + virtual mapbox::feature::feature_collection<double> getChildren(const std::uint32_t) = 0; + virtual mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t, + const std::uint32_t limit = 10u, + const std::uint32_t offset = 0u) = 0; + virtual std::uint8_t getClusterExpansionZoom(std::uint32_t) = 0; }; class GeoJSONSource::Impl : public Source::Impl { |