DefaultFileSource has responsibility for handling mapbox:// URLs

This commit is contained in:
John Firebaugh
2015-05-20 08:21:29 -07:00
committed by Konstantin Käfer
parent f11a9f8fd9
commit 87b1da7611
16 changed files with 62 additions and 71 deletions

View File

@@ -140,14 +140,13 @@ bool Source::isLoaded() const {
// Note: This is a separate function that must be called exactly once after creation
// The reason this isn't part of the constructor is that calling shared_from_this() in
// the constructor fails.
void Source::load(const std::string& accessToken) {
void Source::load() {
if (info.url.empty()) {
loaded = true;
return;
}
const std::string url = util::mapbox::normalizeSourceURL(info.url, accessToken);
req = Environment::Get().request({ Resource::Kind::JSON, url }, [this](const Response &res) {
req = Environment::Get().request({ Resource::Kind::Source, info.url }, [this](const Response &res) {
req = nullptr;
if (res.status != Response::Successful) {