diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-14 10:55:58 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-14 11:25:45 -0700 |
commit | 9dfcb95e4fe333922306eadd4df5cbde2f03a6c1 (patch) | |
tree | 61c7fb9d3dede6097bda1fd35806131cb21ab957 /src/mbgl/style/sources | |
parent | 755cc80edfc53a680030a88a661afe1d9edd1f75 (diff) | |
download | qtlocation-mapboxgl-9dfcb95e4fe333922306eadd4df5cbde2f03a6c1.tar.gz |
[core] Push Source::tileset down to TileSource
Diffstat (limited to 'src/mbgl/style/sources')
-rw-r--r-- | src/mbgl/style/sources/geojson_source.cpp | 10 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source.hpp | 1 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp index dbcef95344..6e1068dadb 100644 --- a/src/mbgl/style/sources/geojson_source.cpp +++ b/src/mbgl/style/sources/geojson_source.cpp @@ -34,7 +34,6 @@ std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> parseGeoJSON(const JSValue& value) std::unique_ptr<GeoJSONSource> GeoJSONSource::parse(const std::string& id, const JSValue& value) { - auto tileset = std::make_unique<Tileset>(); std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> geojsonvt; std::string url; @@ -58,14 +57,13 @@ std::unique_ptr<GeoJSONSource> GeoJSONSource::parse(const std::string& id, return nullptr; } - return std::make_unique<GeoJSONSource>(id, url, std::move(tileset), std::move(geojsonvt)); + return std::make_unique<GeoJSONSource>(id, url, std::move(geojsonvt)); } GeoJSONSource::GeoJSONSource(std::string id_, std::string url_, - std::unique_ptr<Tileset>&& tileset_, std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&& geojsonvt_) - : Source(SourceType::GeoJSON, std::move(id_), std::move(url_), util::tileSize, std::move(tileset_)), + : Source(SourceType::GeoJSON, std::move(id_), std::move(url_), util::tileSize), geojsonvt(std::move(geojsonvt_)) { } @@ -94,8 +92,6 @@ void GeoJSONSource::load(FileSource& fileSource) { } else if (res.noContent) { observer->onSourceError(*this, std::make_exception_ptr(std::runtime_error("unexpectedly empty GeoJSON"))); } else { - std::unique_ptr<Tileset> newTileset = std::make_unique<Tileset>(); - rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> d; d.Parse<0>(res.data->c_str()); @@ -107,11 +103,9 @@ void GeoJSONSource::load(FileSource& fileSource) { } geojsonvt = style::parseGeoJSON(d); - newTileset->zoomRange.max = geojsonvt->options.maxZoom; invalidateTiles(); - tileset = std::move(newTileset); loaded = true; observer->onSourceLoaded(*this); } diff --git a/src/mbgl/style/sources/geojson_source.hpp b/src/mbgl/style/sources/geojson_source.hpp index 83f5290873..7022d387e9 100644 --- a/src/mbgl/style/sources/geojson_source.hpp +++ b/src/mbgl/style/sources/geojson_source.hpp @@ -23,7 +23,6 @@ public: GeoJSONSource(std::string id, std::string url, - std::unique_ptr<Tileset>&&, std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&&); ~GeoJSONSource() final; |