summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-11-16 16:32:09 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-12-15 11:41:58 -0800
commit4fc8226838a23154ca8acc5e5fcb6144de0794cb (patch)
treeac2354fda5e9bca147d7eb3f5bdddbaa291dc319 /include/mbgl
parent62412af6ab746dd8fb5b8984c75b3ff6e6b223e5 (diff)
downloadqtlocation-mapboxgl-4fc8226838a23154ca8acc5e5fcb6144de0794cb.tar.gz
[core] allow changing the orientation
You can now change the orientation of north to be to the right, bottom, left in addition to the default of top
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/map/map.hpp4
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp2
-rw-r--r--include/mbgl/util/geo.hpp8
-rw-r--r--include/mbgl/util/mat4.hpp1
4 files changed, 15 insertions, 0 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index df7597ced4..f8c3f4a172 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -133,6 +133,10 @@ public:
void setPitch(double pitch, const Duration& = Duration::zero());
double getPitch() const;
+ // North Orientation
+ void setNorthOrientation(NorthOrientation);
+ NorthOrientation getNorthOrientation() const;
+
// Size
uint16_t getWidth() const;
uint16_t getHeight() const;
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp
index a434b71bb1..0e46f7d87e 100644
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ b/include/mbgl/platform/default/glfw_view.hpp
@@ -50,6 +50,8 @@ private:
static std::shared_ptr<const mbgl::SpriteImage>
makeSpriteImage(int width, int height, float pixelRatio);
+ void nextOrientation();
+
void addRandomPointAnnotations(int count);
void addRandomShapeAnnotations(int count);
void addRandomCustomPointAnnotations(int count);
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp
index 2f0e4f6fdc..e815456f22 100644
--- a/include/mbgl/util/geo.hpp
+++ b/include/mbgl/util/geo.hpp
@@ -100,6 +100,14 @@ struct MetersBounds {
}
};
+// Determines the orientation of the map.
+enum class NorthOrientation : uint8_t {
+ Upwards, // Default
+ Rightwards,
+ Downwards,
+ Leftwards,
+};
+
} // namespace mbgl
#endif
diff --git a/include/mbgl/util/mat4.hpp b/include/mbgl/util/mat4.hpp
index e5b508e547..59f6e3ee00 100644
--- a/include/mbgl/util/mat4.hpp
+++ b/include/mbgl/util/mat4.hpp
@@ -38,6 +38,7 @@ void perspective(mat4& out, double fovy, double aspect, double near, double far)
void copy(mat4& out, const mat4& a);
void translate(mat4& out, const mat4& a, double x, double y, double z);
void rotate_x(mat4& out, const mat4& a, double rad);
+void rotate_y(mat4& out, const mat4& a, double rad);
void rotate_z(mat4& out, const mat4& a, double rad);
void scale(mat4& out, const mat4& a, double x, double y, double z);
void multiply(mat4& out, const mat4& a, const mat4& b);