summaryrefslogtreecommitdiff
path: root/src/mbgl/layer/layer.cpp
blob: 154fbfe31f971ccddafc958d6cb00040d9e119ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <mbgl/style/layer.hpp>
#include <mbgl/layer/layer_impl.hpp>

namespace mbgl {

Layer::Layer(Type type_, std::unique_ptr<Impl> baseImpl_)
    : baseImpl(std::move(baseImpl_)), type(type_) {
}

Layer::~Layer() = default;

const std::string& Layer::getID() const {
    return baseImpl->id;
}

VisibilityType Layer::getVisibility() const {
    return baseImpl->visibility;
}

void Layer::setVisibility(VisibilityType value) {
    baseImpl->visibility = value;
}

std::unique_ptr<Layer> Layer::copy(const std::string& id,
                                   const std::string& ref) const {
    std::unique_ptr<Layer> result = baseImpl->clone();
    result->baseImpl->id = id;
    result->baseImpl->ref = ref;
    return result;
}

} // namespace mbgl