[core] Adjust layer source properties to better reflect reality
* Layer source ID is immutable; must be provided to the constructor * Layer source layer is mutable * Layers with GeoJSON sources do not have a source layer While here, make Layer::copy impl-private.
This commit is contained in:
@@ -3,6 +3,16 @@
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
std::unique_ptr<Layer> Layer::Impl::copy(const std::string& id_,
|
||||
const std::string& ref_,
|
||||
const std::string& source_) const {
|
||||
std::unique_ptr<Layer> result = clone();
|
||||
result->baseImpl->id = id_;
|
||||
result->baseImpl->ref = ref_;
|
||||
result->baseImpl->source = source_;
|
||||
return result;
|
||||
}
|
||||
|
||||
const std::string& Layer::Impl::bucketName() const {
|
||||
return ref.empty() ? id : ref;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user