diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-02-16 09:52:36 -0800 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2015-02-16 09:52:36 -0800 |
commit | 6e41664cb033ee5edf6ae5ac66ed518d9f0d1f89 (patch) | |
tree | a70192b174ea6dc69b1fa0b13f9a33358a9110e5 /include/mbgl/map/transform_state.hpp | |
parent | ea31ad99a56f1e0afbcc7862ddc62dffd16bc5bb (diff) | |
download | qtlocation-mapboxgl-6e41664cb033ee5edf6ae5ac66ed518d9f0d1f89.tar.gz |
fixes #476 & #853: pixel/meter/latlng conversion routines in core & iOS
Diffstat (limited to 'include/mbgl/map/transform_state.hpp')
-rw-r--r-- | include/mbgl/map/transform_state.hpp | 12 |
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; |