summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources/geojson_source.cpp
diff options
context:
space:
mode:
authorVladimir Agafonkin <agafonkin@gmail.com>2016-07-27 20:18:41 +0300
committerGitHub <noreply@github.com>2016-07-27 20:18:41 +0300
commit9ecc0d95979ca2fa3154f4b47c8f9fa4717fe696 (patch)
treeb5e09683505cec994e3198a92cd8863d54979e3e /src/mbgl/style/sources/geojson_source.cpp
parent6edaf2dc81ab771d1da27c939b19502753aa895f (diff)
downloadqtlocation-mapboxgl-9ecc0d95979ca2fa3154f4b47c8f9fa4717fe696.tar.gz
GeoJSON point clustering (#5724)
* add supercluster dependency * prepare GeoJSONTile for Supercluster * prepare GeoJSONSource for accepting options * try removing mbgl::GeoJSON * fix setGeoJSON types * add GeoJSONSource getURL * add geojson to include path * add Supercluster index in GeoJSONSource * fix GeoJSONSource getZoomRange * bring back mbgl::GeoJSON header * fix tidy warnings hopefully * try test-suite with enabled cluster test * fix formatting in clustering-related files
Diffstat (limited to 'src/mbgl/style/sources/geojson_source.cpp')
-rw-r--r--src/mbgl/style/sources/geojson_source.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index a3eec4f4ef..2bf27880b4 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -4,17 +4,22 @@
namespace mbgl {
namespace style {
-GeoJSONSource::GeoJSONSource(const std::string& id)
- : Source(SourceType::GeoJSON, std::make_unique<GeoJSONSource::Impl>(std::move(id), *this))
- , impl(static_cast<Impl*>(baseImpl.get())) {
+GeoJSONSource::GeoJSONSource(const std::string& id, const GeoJSONOptions options)
+ : Source(SourceType::GeoJSON,
+ std::make_unique<GeoJSONSource::Impl>(std::move(id), *this, options)),
+ impl(static_cast<Impl*>(baseImpl.get())) {
}
void GeoJSONSource::setURL(const std::string& url) {
impl->setURL(url);
}
-void GeoJSONSource::setGeoJSON(GeoJSON&& geoJSON) {
- impl->setGeoJSON(std::move(geoJSON));
+void GeoJSONSource::setGeoJSON(const mapbox::geojson::geojson& geoJSON) {
+ impl->setGeoJSON(geoJSON);
+}
+
+std::string GeoJSONSource::getURL() {
+ return impl->getURL();
}
} // namespace style