summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/line_layer.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-22 12:31:49 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-24 09:39:15 -0700
commitc4e4cc5081965d03132eea754c27ece3c95961cb (patch)
tree3aa4f722ead3273b1faaed5f30449bb8654cf23d /src/mbgl/style/layers/line_layer.cpp
parent089c4e413fbe80711ebd874520d3b8fdcb997112 (diff)
downloadqtlocation-mapboxgl-c4e4cc5081965d03132eea754c27ece3c95961cb.tar.gz
[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.
Diffstat (limited to 'src/mbgl/style/layers/line_layer.cpp')
-rw-r--r--src/mbgl/style/layers/line_layer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp
index abe326a672..e720d1fcfb 100644
--- a/src/mbgl/style/layers/line_layer.cpp
+++ b/src/mbgl/style/layers/line_layer.cpp
@@ -6,10 +6,11 @@
namespace mbgl {
namespace style {
-LineLayer::LineLayer(const std::string& layerID)
+LineLayer::LineLayer(const std::string& layerID, const std::string& sourceID)
: Layer(Type::Line, std::make_unique<Impl>())
, impl(static_cast<Impl*>(baseImpl.get())) {
impl->id = layerID;
+ impl->source = sourceID;
}
LineLayer::LineLayer(const Impl& other)
@@ -25,15 +26,14 @@ std::unique_ptr<Layer> LineLayer::Impl::clone() const {
// Source
-void LineLayer::setSource(const std::string& sourceID, const std::string& sourceLayer) {
- impl->source = sourceID;
- impl->sourceLayer = sourceLayer;
-}
-
const std::string& LineLayer::getSourceID() const {
return impl->source;
}
+void LineLayer::setSourceLayer(const std::string& sourceLayer) {
+ impl->sourceLayer = sourceLayer;
+}
+
const std::string& LineLayer::getSourceLayer() const {
return impl->sourceLayer;
}