diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2014-05-23 18:24:58 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2014-05-23 18:24:58 -0700 |
commit | 3c5a2c79352ea97b042b4ddbad5381d73d994e5d (patch) | |
tree | 816cc6810b38edab4f122461cbced114310451aa /include | |
parent | 07e15927af26c1f985b5c72d54510c9b8805b228 (diff) | |
download | qtlocation-mapboxgl-3c5a2c79352ea97b042b4ddbad5381d73d994e5d.tar.gz |
disallow/undo rotation at low zooms and near world edge
Diffstat (limited to 'include')
-rw-r--r-- | include/llmr/map/map.hpp | 3 | ||||
-rw-r--r-- | include/llmr/map/transform.hpp | 14 | ||||
-rw-r--r-- | include/llmr/map/transform_state.hpp | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 7703b77cb9..ab1738f961 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -73,6 +73,8 @@ public: void resetZoom(); void startScaling(); void stopScaling(); + double getMinZoom(); + double getMaxZoom(); // Rotation void rotateBy(double sx, double sy, double ex, double ey, double duration = 0); @@ -82,6 +84,7 @@ public: void resetNorth(); void startRotating(); void stopRotating(); + bool canRotate(); // Debug void setDebug(bool value); diff --git a/include/llmr/map/transform.hpp b/include/llmr/map/transform.hpp index 4226ec7e40..6ab3d4b841 100644 --- a/include/llmr/map/transform.hpp +++ b/include/llmr/map/transform.hpp @@ -37,16 +37,19 @@ public: void setZoom(double zoom, time duration = 0); double getZoom() const; double getScale() const; - void startRotating(); - void stopRotating(); + void startScaling(); + void stopScaling(); + double getMinZoom(); + double getMaxZoom(); // Angle void rotateBy(double sx, double sy, double ex, double ey, time duration = 0); void setAngle(double angle, time duration = 0); void setAngle(double angle, double cx, double cy); double getAngle() const; - void startScaling(); - void stopScaling(); + void startRotating(); + void stopRotating(); + bool canRotate(); // Transitions bool needsTransition() const; @@ -63,7 +66,7 @@ private: void _moveBy(double dx, double dy, time duration = 0); void _setScale(double scale, double cx, double cy, time duration = 0); void _setScaleXY(double new_scale, double xn, double yn, time duration = 0); - void _setAngle(double angle, time duration = 0); + void _setAngle(double angle, time duration = 0, bool disable_interaction = false); void _clearPanning(); void _clearRotating(); void _clearScaling(); @@ -93,6 +96,7 @@ private: std::shared_ptr<util::transition> scale_timeout; std::shared_ptr<util::transition> rotate_timeout; std::shared_ptr<util::transition> pan_timeout; + std::shared_ptr<util::transition> interaction_timeout; }; } diff --git a/include/llmr/map/transform_state.hpp b/include/llmr/map/transform_state.hpp index 29d0f59c46..b3794e9096 100644 --- a/include/llmr/map/transform_state.hpp +++ b/include/llmr/map/transform_state.hpp @@ -39,6 +39,9 @@ public: // Changing bool isChanging() const; + // Interactive + bool isInteractive() const; + private: double pixel_x() const; double pixel_y() const; @@ -57,6 +60,7 @@ private: bool rotating = false; bool scaling = false; bool panning = false; + bool interactive = true; // map position double x = 0, y = 0; |