begin integrating of area zoom interaction

This commit is contained in:
Hannes Janetzek 2013-03-11 16:11:50 +01:00
parent b0c1f122fe
commit cd54f0dfe6
3 changed files with 22 additions and 19 deletions

View File

@ -37,7 +37,7 @@ import android.graphics.Paint.Cap;
public class PathOverlay extends Overlay {
/** Stores points, converted to the map projection. */
/* package */final ArrayList<GeoPoint> mPoints;
/* package */protected final ArrayList<GeoPoint> mPoints;
/* package */boolean mUpdatePoints;
/** Paint settings. */

View File

@ -15,9 +15,6 @@
*/
package org.oscim.view;
// TODO:
// - fix ray intersection for unproject, see getZ()
import java.lang.ref.WeakReference;
import org.oscim.core.BoundingBox;
@ -149,6 +146,7 @@ public class MapViewPosition {
/**
* get a copy of current matrices
*
* @param view ...
* @param proj ...
* @param vp view and projection
@ -157,7 +155,7 @@ public class MapViewPosition {
if (view != null)
System.arraycopy(mViewMatrix, 0, view, 0, 16);
if (proj!= null)
if (proj != null)
System.arraycopy(mProjMatrix, 0, proj, 0, 16);
if (vp != null)
@ -639,21 +637,23 @@ public class MapViewPosition {
// global scale
mMapScale = (1 << mZoomLevel) * mScale;
//Log.d(TAG, "zoom: " + bbox + " " + zx + " " + zy + " / " + mScale + " " + mZoomLevel);
updatePosition();
setMapCenter(bbox.getCenterPoint());
// reset rotation/tilt
mTilt = 0;
mRotation = 0;
updateMatrix();
GeoPoint geoPoint = bbox.getCenterPoint();
mEndX = MercatorProjection.longitudeToPixelX(geoPoint.getLongitude(), mZoomLevel);
mEndY = MercatorProjection.latitudeToPixelY(geoPoint.getLatitude(), mZoomLevel);
mStartX = mPosX;
mStartY = mPosY;
mDuration = 300;
mHandler.start((int) mDuration);
// updatePosition();
//
// // reset rotation/tilt
// mTilt = 0;
// mRotation = 0;
// updateMatrix();
//
// GeoPoint geoPoint = bbox.getCenterPoint();
// mEndX = MercatorProjection.longitudeToPixelX(geoPoint.getLongitude(), mZoomLevel);
// mEndY = MercatorProjection.latitudeToPixelY(geoPoint.getLatitude(), mZoomLevel);
// mStartX = mPosX;
// mStartY = mPosY;
//
// mDuration = 300;
// mHandler.start((int) mDuration);
}
public synchronized void animateTo(GeoPoint geoPoint) {

View File

@ -157,6 +157,9 @@ final class TouchHandler implements OnGestureListener, OnDoubleTapListener {
if (Math.abs(mx) > JUMP_THRESHOLD || Math.abs(my) > JUMP_THRESHOLD)
return true;
if (e.getPointerCount() < 2)
return true;
if (mMulti == 0)
return true;