Files
MapLibreParticleLab/include/mbgl/style/sources/geojson_source.hpp
Vladimir Agafonkin 9ecc0d9597 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
2016-07-27 20:18:41 +03:00

55 lines
1.1 KiB
C++

#pragma once
#include <mbgl/style/source.hpp>
#include <mbgl/util/geojson.hpp>
#include <mapbox/geojson.hpp>
namespace mapbox {
namespace geojsonvt {
class GeoJSONVT;
} // namespace geojsonvt
namespace supercluster {
class Supercluster;
} // namespace supercluster
} // namespace mapbox
namespace mbgl {
namespace style {
using GeoJSONVTPointer = std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>;
using SuperclusterPointer = std::unique_ptr<mapbox::supercluster::Supercluster>;
struct GeoJSONOptions {
// GeoJSON-VT options
uint8_t maxzoom = 18;
uint16_t buffer = 128;
double tolerance = 0.375;
// Supercluster options
bool cluster = false;
uint16_t clusterRadius = 50;
uint8_t clusterMaxZoom = 17;
};
class GeoJSONSource : public Source {
public:
GeoJSONSource(const std::string& id, const GeoJSONOptions options_ = GeoJSONOptions());
void setURL(const std::string& url);
void setGeoJSON(const GeoJSON&);
std::string getURL();
// Private implementation
class Impl;
Impl* const impl;
};
} // namespace style
} // namespace mbgl