summaryrefslogtreecommitdiff
path: root/include/mbgl/map/transform_state.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map/transform_state.hpp')
-rw-r--r--include/mbgl/map/transform_state.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/mbgl/map/transform_state.hpp b/include/mbgl/map/transform_state.hpp
index 6dc34bd873..5f2dfa49e4 100644
--- a/include/mbgl/map/transform_state.hpp
+++ b/include/mbgl/map/transform_state.hpp
@@ -4,6 +4,8 @@
#include <mbgl/map/tile.hpp>
#include <mbgl/util/mat4.hpp>
+#include <mbgl/util/geo.hpp>
+#include <mbgl/util/vec.hpp>
#include <cstdint>
#include <array>
@@ -34,6 +36,9 @@ public:
std::array<float, 2> locationCoordinate(float lon, float lat) const;
void getLonLat(double &lon, double &lat) const;
+ // Position
+ const LatLng getLatLng() const;
+
// Zoom
float getNormalizedZoom() const;
double getZoom() const;
@@ -44,6 +49,10 @@ public:
// Rotation
float getAngle() const;
+ // Projection
+ const vec2<double> pixelForLatLng(const LatLng latLng) const;
+ const LatLng latLngForPixel(const vec2<double> pixel) const;
+
// Changing
bool isChanging() const;
@@ -61,6 +70,9 @@ private:
// map scale factor
float pixelRatio = 0;
+ // cache values for spherical mercator math
+ double Bc, Cc;
+
// animation state
bool rotating = false;
bool scaling = false;