summaryrefslogtreecommitdiff
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-10 11:57:55 +0200
commit0aa30671abcf560ee06599440b0d30d589a2e45a (patch)
treed76f7ddaf2a5013fd5115846ac9a9f905513d17e
parent04c70f55a534ca7cb4bb5358da3217329643a0f0 (diff)
downloadqtlocation-mapboxgl-0aa30671abcf560ee06599440b0d30d589a2e45a.tar.gz
[core] Expose getChildren, getLeaves, getClusterExpansionZoom on SuperclusterData
-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 {