summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-14 12:46:29 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-15 11:28:34 -0700
commit41760b5696e71c3d201d94d5c8b2423c1f348446 (patch)
tree4483b3e5795410e96dc2629a798cf285528241e2 /platform
parent87edff4047ddaf5a49b31c060bfae55d74d6c0cb (diff)
downloadqtlocation-mapboxgl-41760b5696e71c3d201d94d5c8b2423c1f348446.tar.gz
[core] Use variant<std::string, GeoJSON> in GeoJSON source
Diffstat (limited to 'platform')
-rw-r--r--platform/default/mbgl/storage/offline_download.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/platform/default/mbgl/storage/offline_download.cpp b/platform/default/mbgl/storage/offline_download.cpp
index 3d0ebaa68f..3f21b8571e 100644
--- a/platform/default/mbgl/storage/offline_download.cpp
+++ b/platform/default/mbgl/storage/offline_download.cpp
@@ -127,7 +127,9 @@ OfflineRegionStatus OfflineDownload::getStatus() const {
case SourceType::GeoJSON: {
style::GeoJSONSource* geojsonSource = static_cast<style::GeoJSONSource*>(source.get());
- if (!geojsonSource->getURL().empty()) {
+ const variant<std::string, style::GeoJSONSource::GeoJSON>& urlOrGeoJSON = geojsonSource->getURLOrGeoJSON();
+
+ if (urlOrGeoJSON.is<std::string>()) {
result.requiredResourceCount += 1;
}
break;
@@ -188,8 +190,10 @@ void OfflineDownload::activateDownload() {
case SourceType::GeoJSON: {
style::GeoJSONSource* geojsonSource = static_cast<style::GeoJSONSource*>(source.get());
- if (!geojsonSource->getURL().empty()) {
- ensureResource(Resource::source(geojsonSource->getURL()));
+ const variant<std::string, style::GeoJSONSource::GeoJSON>& urlOrGeoJSON = geojsonSource->getURLOrGeoJSON();
+
+ if (urlOrGeoJSON.is<std::string>()) {
+ ensureResource(Resource::source(urlOrGeoJSON.get<std::string>()));
}
break;
}