public void panAndZoom(int minX,int minY,int maxX,int maxY){
  float currZoom=mapController.getZoom();
  LngLat tl=Util.normalizeLngLat(mapController.coordinatesAtScreenPosition(0,0));
  LngLat br=Util.normalizeLngLat(mapController.coordinatesAtScreenPosition(windowWidth,windowHeight));
  int fromMinX=AreaPanel.convertLonToX(tl.longitude);
  int fromMinY=AreaPanel.convertLatToY(tl.latitude);
  int fromMaxX=AreaPanel.convertLonToX(br.longitude);
  int fromMaxY=AreaPanel.convertLatToY(br.latitude);
  maxY=(int)(((float)maxY - minY) * windowHeight / pointAreaHeight) + minY;
  float zoomMultiplier=Math.min(((float)fromMaxX - fromMinX) / (maxX - minX),((float)fromMaxY - fromMinY) / (maxY - minY));
  float newZoom=(float)(currZoom + Math.log(zoomMultiplier) / Math.log(2));
  LngLat newPos=new LngLat(AreaPanel.convertXToLon((maxX - minX) / 2 + minX),AreaPanel.convertYToLat((maxY - minY) / 2 + minY));
  mapController.setPositionEased(newPos,AUTOZOOM_PAN_EASE_MS);
  mapController.setZoomEased(newZoom,AUTOZOOM_ZOOM_EASE_MS);
  notifyScreenMoved();
}

public void panAndZoom ( int minX , int minY , int maxX , int maxY ) { float currZoom = mapController . getZoom ( ) ; LngLat tl = Util . normalizeLngLat ( mapController . coordinatesAtScreenPosition ( 0 , 0 ) ) ; LngLat br = Util . normalizeLngLat ( mapController . coordinatesAtScreenPosition ( windowWidth , windowHeight ) ) ; int fromMinX = AreaPanel . convertLonToX ( tl . longitude ) ; int fromMinY = AreaPanel . convertLatToY ( tl . latitude ) ; int fromMaxX = AreaPanel . convertLonToX ( br . longitude ) ; int fromMaxY = AreaPanel . convertLatToY ( br . latitude ) ; maxY = ( int ) ( ( ( float ) maxY - minY ) * windowHeight / pointAreaHeight ) + minY ; float zoomMultiplier = Math . min ( ( ( float ) fromMaxX - fromMinX ) / ( maxX - minX ) , ( ( float ) fromMaxY - fromMinY ) / ( maxY - minY ) ) ; float newZoom = ( float ) ( currZoom + Math . log ( zoomMultiplier ) / Math . log ( 2 ) ) ; LngLat newPos = new LngLat ( AreaPanel . convertXToLon ( ( maxX - minX ) / 2 + minX ) , AreaPanel . convertYToLat ( ( maxY - minY ) / 2 + minY ) ) ; mapController . setPositionEased ( newPos , AUTOZOOM_PAN_EASE_MS ) ; mapController . setZoomEased ( newZoom , AUTOZOOM_ZOOM_EASE_MS ) ; notifyScreenMoved ( ) ; }
pans and zooms so the given points will show up as the top left and bottom right of the view . note that the zooming / panning will be done so that the given bottom will be placed above the time view and the zoom buttons .
