public void adjust(Collection<MapNode> nodes){
  for (  MapNode node : nodes) {
    if (Float.isNaN(latMin)) {
      latMin=latMax=node.getLat();
      lonMin=lonMax=node.getLon();
    }
 else     if (node.hasPosition()) {
      if (node.getLat() < latMin)       latMin=node.getLat();
 else       if (node.getLat() > latMax)       latMax=node.getLat();
      if (node.getLon() < lonMin)       lonMin=node.getLon();
 else       if (node.getLon() > lonMax)       lonMax=node.getLon();
    }
  }
}

public void adjust ( Collection < MapNode > nodes ) { for ( MapNode node : nodes ) { if ( Float . isNaN ( latMin ) ) { latMin = latMax = node . getLat ( ) ; lonMin = lonMax = node . getLon ( ) ; } else if ( node . hasPosition ( ) ) { if ( node . getLat ( ) < latMin ) latMin = node . getLat ( ) ; else if ( node . getLat ( ) > latMax ) latMax = node . getLat ( ) ; if ( node . getLon ( ) < lonMin ) lonMin = node . getLon ( ) ; else if ( node . getLon ( ) > lonMax ) lonMax = node . getLon ( ) ; } } }
makes sure , that all given nodes are within the box and extends the bounds if necessary .
