[android] Adjust annotation touch tolerance to match default marker

For #1504
This commit is contained in:
Leith Bade
2015-10-30 15:03:14 +11:00
parent 212ea7a19e
commit e0fd0fc071

View File

@@ -2329,11 +2329,12 @@ public final class MapView extends FrameLayout {
// Open / Close InfoWindow
PointF tapPoint = new PointF(e.getX(), e.getY());
float toleranceWidth = 40 * mScreenDensity;
float toleranceHeight = 60 * mScreenDensity;
final float toleranceSides = 30 * mScreenDensity;
final float toleranceTop = 40 * mScreenDensity;
final float toleranceBottom = 10 * mScreenDensity;
RectF tapRect = new RectF(tapPoint.x - toleranceWidth / 2, tapPoint.y - 2 * toleranceHeight / 3,
tapPoint.x + toleranceWidth / 2, tapPoint.y + 1 * toleranceHeight / 3);
RectF tapRect = new RectF(tapPoint.x - toleranceSides, tapPoint.y + toleranceTop,
tapPoint.x + toleranceSides, tapPoint.y - toleranceBottom);
List<LatLng> corners = Arrays.asList(
fromScreenLocation(new PointF(tapRect.left, tapRect.bottom)),