protected void goTo(ImageTile[] selectedTiles2){
  if (mapBean == null) {
    MapHandler bc=(MapHandler)getBeanContext();
    if (bc != null) {
      mapBean=(MapBean)bc.get(com.bbn.openmap.MapBean.class);
    }
  }
  if (mapBean != null) {
    if (selectedTiles != null && selectedTiles.length > 0) {
      Rectangle2D rec=null;
      for (int i=selectedTiles2.length - 1; i >= 0; i--) {
        ImageTile tile=selectedTiles2[i];
        if (rec == null) {
          rec=new Rectangle2D.Double(tile.getLRLon(),tile.getLRLat(),0f,0f);
          rec.add(tile.getULLon(),tile.getULLat());
        }
 else {
          rec.add(tile.getULLon(),tile.getULLat());
          rec.add(tile.getLRLon(),tile.getLRLat());
        }
      }
      if (rec != null) {
        Point2D center=new Point2D.Double(rec.getCenterX(),rec.getCenterY());
        Point2D anchor1=new Point2D.Double(rec.getMinX(),rec.getMaxY());
        Point2D anchor2=new Point2D.Double(rec.getMaxX(),rec.getMinY());
        Proj proj=(Proj)mapBean.getProjection();
        float scale=proj.getScale(anchor1,anchor2,proj.forward(anchor1),proj.forward(anchor2));
        if (logger.isLoggable(Level.FINE)) {
          logger.fine("Images cover " + anchor1 + " to "+ anchor2+ ", scale adjusted to "+ scale);
        }
        proj.setCenter(center);
        proj.setScale(scale);
        mapBean.setProjection(proj);
      }
    }
  }
}

protected void goTo ( ImageTile [ ] selectedTiles2 ) { if ( mapBean == null ) { MapHandler bc = ( MapHandler ) getBeanContext ( ) ; if ( bc != null ) { mapBean = ( MapBean ) bc . get ( com . bbn . openmap . MapBean . class ) ; } } if ( mapBean != null ) { if ( selectedTiles != null && selectedTiles . length > 0 ) { Rectangle2D rec = null ; for ( int i = selectedTiles2 . length - 1 ; i >= 0 ; i -- ) { ImageTile tile = selectedTiles2 [ i ] ; if ( rec == null ) { rec = new Rectangle2D . Double ( tile . getLRLon ( ) , tile . getLRLat ( ) , 0f , 0f ) ; rec . add ( tile . getULLon ( ) , tile . getULLat ( ) ) ; } else { rec . add ( tile . getULLon ( ) , tile . getULLat ( ) ) ; rec . add ( tile . getLRLon ( ) , tile . getLRLat ( ) ) ; } } if ( rec != null ) { Point2D center = new Point2D . Double ( rec . getCenterX ( ) , rec . getCenterY ( ) ) ; Point2D anchor1 = new Point2D . Double ( rec . getMinX ( ) , rec . getMaxY ( ) ) ; Point2D anchor2 = new Point2D . Double ( rec . getMaxX ( ) , rec . getMinY ( ) ) ; Proj proj = ( Proj ) mapBean . getProjection ( ) ; float scale = proj . getScale ( anchor1 , anchor2 , proj . forward ( anchor1 ) , proj . forward ( anchor2 ) ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Images cover " + anchor1 + " to " + anchor2 + ", scale adjusted to " + scale ) ; } proj . setCenter ( center ) ; proj . setScale ( scale ) ; mapBean . setProjection ( proj ) ; } } } }
figure out where the images are and move the mapbean over them .
