diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-27 16:03:04 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-02 14:51:39 -0700 |
commit | 18149cbcc27a926f280b08d8d0e09104b2147688 (patch) | |
tree | 924bc6665f19f5bf768d84a808801646ef9f16d9 | |
parent | 67ee51360c1bf72d54544cecb8d8fd638ad4df14 (diff) | |
download | qtlocation-mapboxgl-18149cbcc27a926f280b08d8d0e09104b2147688.tar.gz |
[core] Add {min,max}Zoom accessors
-rw-r--r-- | include/mbgl/style/layer.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/layer/layer.cpp | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp index e6c33a9784..4a40cc0cff 100644 --- a/include/mbgl/style/layer.hpp +++ b/include/mbgl/style/layer.hpp @@ -49,6 +49,12 @@ public: VisibilityType getVisibility() const; void setVisibility(VisibilityType); + // Zoom range + float getMinZoom() const; + void setMinZoom(float) const; + float getMaxZoom() const; + void setMaxZoom(float) const; + // Create a new layer with the specified `id` and `ref`. All other properties // are copied from this layer. std::unique_ptr<Layer> copy(const std::string& id, diff --git a/src/mbgl/layer/layer.cpp b/src/mbgl/layer/layer.cpp index 154fbfe31f..c26eb9a723 100644 --- a/src/mbgl/layer/layer.cpp +++ b/src/mbgl/layer/layer.cpp @@ -21,6 +21,22 @@ void Layer::setVisibility(VisibilityType value) { baseImpl->visibility = value; } +float Layer::getMinZoom() const { + return baseImpl->minZoom; +} + +void Layer::setMinZoom(float minZoom) const { + baseImpl->minZoom = minZoom; +} + +float Layer::getMaxZoom() const { + return baseImpl->maxZoom; +} + +void Layer::setMaxZoom(float maxZoom) const { + baseImpl->maxZoom = maxZoom; +} + std::unique_ptr<Layer> Layer::copy(const std::string& id, const std::string& ref) const { std::unique_ptr<Layer> result = baseImpl->clone(); |