summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-13 15:00:57 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-14 11:25:45 -0700
commit755cc80edfc53a680030a88a661afe1d9edd1f75 (patch)
tree2edaf1b7a0b717102c2be73a74d4520925501cb5 /src/mbgl/style/sources
parent6eab895bc0683881f793a3a751fa7470603ae9a0 (diff)
downloadqtlocation-mapboxgl-755cc80edfc53a680030a88a661afe1d9edd1f75.tar.gz
[core] Add virtual Source::getZoomRange()
Diffstat (limited to 'src/mbgl/style/sources')
-rw-r--r--src/mbgl/style/sources/geojson_source.cpp5
-rw-r--r--src/mbgl/style/sources/geojson_source.hpp1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index d720e38e51..dbcef95344 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -53,7 +53,6 @@ std::unique_ptr<GeoJSONSource> GeoJSONSource::parse(const std::string& id,
} else if (dataVal.IsObject()) {
// We need to parse dataVal as a GeoJSON object
geojsonvt = parseGeoJSON(dataVal);
- tileset->zoomRange.max = geojsonvt->options.maxZoom;
} else {
Log::Error(Event::ParseStyle, "GeoJSON data must be a URL or an object");
return nullptr;
@@ -72,6 +71,10 @@ GeoJSONSource::GeoJSONSource(std::string id_,
GeoJSONSource::~GeoJSONSource() = default;
+Range<uint8_t> GeoJSONSource::getZoomRange() {
+ return { 0, geojsonvt->options.maxZoom };
+}
+
void GeoJSONSource::load(FileSource& fileSource) {
if (url.empty()) {
// If the URL is empty, the GeoJSON was specified inline in the stylesheet.
diff --git a/src/mbgl/style/sources/geojson_source.hpp b/src/mbgl/style/sources/geojson_source.hpp
index 08ccf84760..83f5290873 100644
--- a/src/mbgl/style/sources/geojson_source.hpp
+++ b/src/mbgl/style/sources/geojson_source.hpp
@@ -30,6 +30,7 @@ public:
void load(FileSource&) final;
private:
+ Range<uint8_t> getZoomRange() final;
std::unique_ptr<Tile> createTile(const OverscaledTileID&, const UpdateParameters&) final;
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> geojsonvt;