summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layer_impl.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/layer_impl.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/layer_impl.cpp')
-rw-r--r--src/mbgl/style/layer_impl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mbgl/style/layer_impl.cpp b/src/mbgl/style/layer_impl.cpp
index 74cc80d253..b345297027 100644
--- a/src/mbgl/style/layer_impl.cpp
+++ b/src/mbgl/style/layer_impl.cpp
@@ -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;
}