[core] Load source TileJSON immediately
This reverses #3095. Rationale: * We're now exposing source attributes as a public API. Making those attributes unavailable at certain times complicates that API. * We're preparing to split RenderSource out of Source. Removing this removes a point of coupling between the two.
This commit is contained in:
@@ -164,6 +164,8 @@ void Style::addSource(std::unique_ptr<Source> source) {
|
||||
}
|
||||
|
||||
source->baseImpl->setObserver(this);
|
||||
source->baseImpl->loadDescription(fileSource);
|
||||
|
||||
sources.emplace_back(std::move(source));
|
||||
}
|
||||
|
||||
@@ -387,9 +389,6 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
|
||||
// If this layer has a source, make sure that it gets loaded.
|
||||
if (Source* source = getSource(layer->baseImpl.source)) {
|
||||
source->baseImpl->enabled = true;
|
||||
if (!source->baseImpl->loaded) {
|
||||
source->baseImpl->loadDescription(fileSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user