private boolean isTileVisible ( final ReferencedEnvelope tileBounds ) { if ( FloatingPointUtil . equals ( this . transformer . getRotation ( ) , 0.0 ) ) { return true ; } final GeometryFactory gfac = new GeometryFactory ( ) ; final Optional < Geometry > rotatedMapBounds = getRotatedMapBounds ( gfac ) ; if ( rotatedMapBounds . isPresent ( ) ) { return rotatedMapBounds . get ( ) . intersects ( gfac . toGeometry ( tileBounds ) ) ; } else { // in case of an error, we simply load the tile return true ; } }
When using a map rotation there might be tiles that are outside the rotated map area . To avoid to load these tiles this method checks if a tile is really required to draw the map .