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.Float(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) {
LatLonPoint center = new LatLonPoint(rec.getCenterY(), rec.getCenterX());