[core] Change GeoJSONSource::getURL() to return an optional<std::string>

GeoJSON sources may have inline GeoJSON rather than a URL; returning an optional type ensures that consumers handle this case.
This commit is contained in:
John Firebaugh
2016-08-25 17:44:44 -07:00
parent 50ae6c738a
commit d2abb1b6d5
5 changed files with 22 additions and 23 deletions

View File

@@ -205,8 +205,8 @@ void OfflineDownload::activateDownload() {
style::GeoJSONSource::Impl* geojsonSource =
static_cast<style::GeoJSONSource::Impl*>(source->baseImpl.get());
if (!geojsonSource->loaded) {
ensureResource(Resource::source(geojsonSource->getURL()));
if (geojsonSource->getURL()) {
ensureResource(Resource::source(*geojsonSource->getURL()));
}
break;
}