blob: 5b39d7821ba6cebec0c11b64b9c25e4e93ee1380 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#pragma once
#include <mbgl/style/source.hpp>
#include <mbgl/util/geojson.hpp>
#include <mbgl/util/optional.hpp>
namespace mbgl {
namespace style {
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& = {});
void setURL(const std::string& url);
void setGeoJSON(const GeoJSON&);
optional<std::string> getURL() const;
// Private implementation
class Impl;
Impl* const impl;
};
template <>
inline bool Source::is<GeoJSONSource>() const {
return type == SourceType::GeoJSON;
}
} // namespace style
} // namespace mbgl
|