summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-30 11:30:54 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-31 10:24:55 +0200
commit8c498cd36c07b1019e5ddb60d5f9f8872f036e25 (patch)
treeea5c5578ae0433c9c3fff9da42c221d99c72ddfc /include
parent6900ac9837c6981b2a3f8d389ac09c0fca56b749 (diff)
downloadqtlocation-mapboxgl-8c498cd36c07b1019e5ddb60d5f9f8872f036e25.tar.gz
[core] Introduce and apply GeoJSONData::create() API
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index a256ad6f15..c8dc65b912 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -2,6 +2,7 @@
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/source.hpp>
+#include <mbgl/tile/tile_id.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/geojson.hpp>
#include <mbgl/util/optional.hpp>
@@ -34,6 +35,20 @@ struct GeoJSONOptions {
using ClusterProperties = std::unordered_map<std::string, ClusterExpression>;
ClusterProperties clusterProperties;
};
+class GeoJSONData {
+public:
+ static std::shared_ptr<GeoJSONData> create(const GeoJSON&, const GeoJSONOptions&);
+
+ 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 final : public Source {
public:
@@ -42,6 +57,7 @@ public:
void setURL(const std::string& url);
void setGeoJSON(const GeoJSON&);
+ void setGeoJSONData(std::shared_ptr<GeoJSONData>);
optional<std::string> getURL() const;