diff --git a/docs/Changelog.md b/docs/Changelog.md index 86b3f45d..62b2ed56 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -5,7 +5,7 @@ - Mapsforge themes compatibility [#100](https://github.com/mapsforge/vtm/issues/100) - Render themes: line symbol [#124](https://github.com/mapsforge/vtm/issues/124) - Render themes: stroke dash array [#131](https://github.com/mapsforge/vtm/issues/131) -- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405) +- Two finger tap zoom out gesture [#423](https://github.com/mapsforge/vtm/issues/423) - POI Search example [#394](https://github.com/mapsforge/vtm/issues/394) - Mapsforge Reverse Geocoding [#383](https://github.com/mapsforge/vtm/issues/383) - Core utilities [#396](https://github.com/mapsforge/vtm/issues/396) @@ -14,6 +14,7 @@ - Mapsforge fix artifacts zoom >17 [#231](https://github.com/mapsforge/vtm/issues/231) - Mapzen building extrusions [#419](https://github.com/mapsforge/vtm/issues/419) - BuildingLayer expects height tags in meters +- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405) - PolyLabel default disabled [#402](https://github.com/mapsforge/vtm/issues/402) - vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387) - Feature parameters [#403](https://github.com/mapsforge/vtm/issues/403) diff --git a/vtm/src/org/oscim/layers/MapEventLayer.java b/vtm/src/org/oscim/layers/MapEventLayer.java index 2af1a16e..5013ab6c 100644 --- a/vtm/src/org/oscim/layers/MapEventLayer.java +++ b/vtm/src/org/oscim/layers/MapEventLayer.java @@ -1,6 +1,6 @@ /* * Copyright 2013 Hannes Janetzek - * Copyright 2016 devemux86 + * Copyright 2016-2017 devemux86 * Copyright 2016 Andrey Novikov * Copyright 2016 Longri * @@ -59,6 +59,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene private boolean mDown; private boolean mDoubleTap; private boolean mDragZoom; + private boolean mTwoFingersDone; private float mPrevX1; private float mPrevY1; @@ -157,6 +158,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene mStartMove = -1; mDoubleTap = false; mDragZoom = false; + mTwoFingersDone = false; mPrevX1 = e.getX(0); mPrevY1 = e.getY(0); @@ -211,6 +213,11 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene return true; } if (action == MotionEvent.ACTION_POINTER_UP) { + if (e.getPointerCount() == 2 && !mTwoFingersDone) { + if (!mMap.handleGesture(Gesture.TWO_FINGER_TAP, e)) { + mMap.animator().animateZoom(300, 0.5, 0f, 0f); + } + } updateMulti(e); return true; } @@ -306,6 +313,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene mCanScale = false; mCanRotate = false; mDoTilt = true; + mTwoFingersDone = true; } } } @@ -332,6 +340,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene /* start rotate, disable tilt */ mDoRotate = true; mCanTilt = false; + mTwoFingersDone = true; mAngle = rad; } else if (!mDoScale) { @@ -351,6 +360,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene mDoRotate = true; mCanRotate = true; mAngle = rad; + mTwoFingersDone = true; } } @@ -366,6 +376,7 @@ public class MapEventLayer extends AbstractMapEventLayer implements InputListene mCanTilt = false; mDoScale = true; + mTwoFingersDone = true; } } if (mDoScale || mDoRotate) {