summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2018-11-14 16:34:21 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2018-12-12 15:08:18 +0200
commit8a03d16990b6fdde0f117def3a1b4bb2c9c92d4c (patch)
tree39dc300ae6ad22ff706da604d5d6e36daf0a2001 /src/mbgl
parentbd7c73f8e4270a9fb021ca90c528ea0825077657 (diff)
downloadqtlocation-mapboxgl-8a03d16990b6fdde0f117def3a1b4bb2c9c92d4c.tar.gz
[core] Expose getChildren, getLeaves, getClusterExpansionZoom on SuperclusterData
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.cpp28
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.hpp7
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 {