protected void setLatLonAnimate(double latitude, double longitude, boolean notify) { currentViewport.setLatLonCenter(latitude, longitude); refreshMap(); if (locationListener != null && notify) { locationListener.locationChanged(latitude, longitude, this); } }
protected void setZoomAnimate(int zoom, float zoomScale, boolean notify) { currentViewport.setZoom(zoom, zoomScale, 0); refreshMap(); if (locationListener != null && notify) { locationListener.locationChanged(getLatitude(), getLongitude(), this); } }
/** These methods do not consider rotating */ protected void dragToAnimate(float fromX, float fromY, float toX, float toY, boolean notify) { float dx = (fromX - toX); float dy = (fromY - toY); moveTo(dx, dy); if (locationListener != null && notify) { locationListener.locationChanged(getLatitude(), getLongitude(), this); } }
// for internal usage protected void zoomToAnimate(float tzoom, boolean notify) { int zoom = getZoom(); float zoomToAnimate = tzoom - zoom - getZoomScale(); if (zoomToAnimate >= 1) { zoom += (int) zoomToAnimate; zoomToAnimate -= (int) zoomToAnimate; } while (zoomToAnimate < 0) { zoom--; zoomToAnimate += 1; } if (mainLayer != null && mainLayer.getMaximumShownMapZoom() >= zoom && mainLayer.getMinimumShownMapZoom() <= zoom) { currentViewport.setZoomAndAnimation(zoom, zoomToAnimate); currentViewport.setRotate(zoom > LOWEST_ZOOM_TO_ROTATE ? rotate : 0); refreshMap(); if (notify && locationListener != null) { locationListener.locationChanged(getLatitude(), getLongitude(), this); } } }