summaryrefslogtreecommitdiff
path: root/include/mbgl/style/sources/geojson_source.hpp
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2019-08-16 15:03:48 +0300
committerGitHub <noreply@github.com>2019-08-16 15:03:48 +0300
commit0f34eb7b253e83b8c4aef7ed6c83cd7b3801fa4c (patch)
treea0e06d1c81b04fca84f8ed8effeaeaefc2e79e13 /include/mbgl/style/sources/geojson_source.hpp
parent9f8696c00c7ef11abb3850e4694bc7375365295e (diff)
downloadqtlocation-mapboxgl-0f34eb7b253e83b8c4aef7ed6c83cd7b3801fa4c.tar.gz
Indroduce clusterProperty option for aggregation (#15287)
* indroduce clusterProperty option for aggregation * remove unnecessary codes * update geojson_option conversion * fix reviewing findings
Diffstat (limited to 'include/mbgl/style/sources/geojson_source.hpp')
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index a03b910279..4aec1584a6 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -1,9 +1,14 @@
#pragma once
+#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/source.hpp>
+#include <mbgl/util/constants.hpp>
#include <mbgl/util/geojson.hpp>
#include <mbgl/util/optional.hpp>
-#include <mbgl/util/constants.hpp>
+
+#include <memory>
+#include <unordered_map>
+#include <utility>
namespace mbgl {
@@ -24,11 +29,15 @@ struct GeoJSONOptions {
bool cluster = false;
uint16_t clusterRadius = 50;
uint8_t clusterMaxZoom = 17;
+ using ClusterExpression = std::pair<std::shared_ptr<mbgl::style::expression::Expression>,
+ std::shared_ptr<mbgl::style::expression::Expression>>;
+ using ClusterProperties = std::unordered_map<std::string, ClusterExpression>;
+ ClusterProperties clusterProperties;
};
class GeoJSONSource : public Source {
public:
- GeoJSONSource(const std::string& id, const GeoJSONOptions& = {});
+ GeoJSONSource(const std::string& id, optional<GeoJSONOptions> = nullopt);
~GeoJSONSource() final;
void setURL(const std::string& url);