summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/raster_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/raster_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/raster_layer.cpp')
-rw-r--r--src/mbgl/style/layers/raster_layer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp
index fb7f08fbe9..cdba19ac4e 100644
--- a/src/mbgl/style/layers/raster_layer.cpp
+++ b/src/mbgl/style/layers/raster_layer.cpp
@@ -6,10 +6,11 @@
namespace mbgl {
namespace style {
-RasterLayer::RasterLayer(const std::string& layerID)
+RasterLayer::RasterLayer(const std::string& layerID, const std::string& sourceID)
: Layer(Type::Raster, std::make_unique<Impl>())
, impl(static_cast<Impl*>(baseImpl.get())) {
impl->id = layerID;
+ impl->source = sourceID;
}
RasterLayer::RasterLayer(const Impl& other)
@@ -25,14 +26,11 @@ std::unique_ptr<Layer> RasterLayer::Impl::clone() const {
// Source
-void RasterLayer::setSource(const std::string& sourceID) {
- impl->source = sourceID;
-}
-
const std::string& RasterLayer::getSourceID() const {
return impl->source;
}
+
// Layout properties