From 11afef7825d622a237fa026e45e6d61b4de94068 Mon Sep 17 00:00:00 2001 From: Sudarsana Babu Nagineni Date: Mon, 25 Mar 2019 23:39:31 +0200 Subject: [core] Add interface to change the orientation through MapOptions --- include/mbgl/map/map.hpp | 5 +---- include/mbgl/map/map_options.hpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'include/mbgl') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index bd0cfbc0d7..9134272ea7 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -87,11 +87,8 @@ public: /// @} - // North Orientation - void setNorthOrientation(NorthOrientation); - NorthOrientation getNorthOrientation() const; - // Map Options + void setNorthOrientation(NorthOrientation); void setConstrainMode(ConstrainMode); void setViewportMode(ViewportMode); MapOptions getMapOptions() const; diff --git a/include/mbgl/map/map_options.hpp b/include/mbgl/map/map_options.hpp index 617a2d793a..8d5c12b96c 100644 --- a/include/mbgl/map/map_options.hpp +++ b/include/mbgl/map/map_options.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -86,6 +87,22 @@ public: */ bool crossSourceCollisions() const; + /** + * @brief Sets the orientation of the Map. By default, it is set to + * Upwards. + * + * @param orientation Orientation of the Map. + * @return reference to MapOptions for chaining options together. + */ + MapOptions& withNorthOrientation(NorthOrientation orientation); + + /** + * @brief Gets the previously set (or default) orientation. + * + * @return Map orientation. + */ + NorthOrientation northOrientation() const; + private: class Impl; std::unique_ptr impl_; -- cgit v1.2.1