[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:
@@ -6,10 +6,11 @@
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
CircleLayer::CircleLayer(const std::string& layerID)
|
||||
CircleLayer::CircleLayer(const std::string& layerID, const std::string& sourceID)
|
||||
: Layer(Type::Circle, std::make_unique<Impl>())
|
||||
, impl(static_cast<Impl*>(baseImpl.get())) {
|
||||
impl->id = layerID;
|
||||
impl->source = sourceID;
|
||||
}
|
||||
|
||||
CircleLayer::CircleLayer(const Impl& other)
|
||||
@@ -25,15 +26,14 @@ std::unique_ptr<Layer> CircleLayer::Impl::clone() const {
|
||||
|
||||
// Source
|
||||
|
||||
void CircleLayer::setSource(const std::string& sourceID, const std::string& sourceLayer) {
|
||||
impl->source = sourceID;
|
||||
impl->sourceLayer = sourceLayer;
|
||||
}
|
||||
|
||||
const std::string& CircleLayer::getSourceID() const {
|
||||
return impl->source;
|
||||
}
|
||||
|
||||
void CircleLayer::setSourceLayer(const std::string& sourceLayer) {
|
||||
impl->sourceLayer = sourceLayer;
|
||||
}
|
||||
|
||||
const std::string& CircleLayer::getSourceLayer() const {
|
||||
return impl->sourceLayer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user