summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-25 23:39:31 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-28 16:41:15 +0200
commit11afef7825d622a237fa026e45e6d61b4de94068 (patch)
tree85f2eaa3f145a59a869ed29311369649df4388cb /include
parente639087c9103b25bd0ea7594ab4280c227243f88 (diff)
downloadqtlocation-mapboxgl-11afef7825d622a237fa026e45e6d61b4de94068.tar.gz
[core] Add interface to change the orientation through MapOptions
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map.hpp5
-rw-r--r--include/mbgl/map/map_options.hpp17
2 files changed, 18 insertions, 4 deletions
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 <mbgl/map/mode.hpp>
+#include <mbgl/util/geo.hpp>
#include <memory>
@@ -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> impl_;