public final class BBoxMapBounds extends MapBounds
| Constructor and Description |
|---|
BBoxMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double minX,
double minY,
double maxX,
double maxY)
Constructor.
|
BBoxMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
com.vividsolutions.jts.geom.Envelope envelope)
Constructor.
|
BBoxMapBounds(org.geotools.geometry.jts.ReferencedEnvelope bbox)
Create from a bbox.
|
| Modifier and Type | Method and Description |
|---|---|
MapBounds |
adjustBoundsToNearestScale(ZoomLevels zoomLevels,
double tolerance,
ZoomLevelSnapStrategy zoomLevelSnapStrategy,
boolean geodetic,
java.awt.Rectangle paintArea,
double dpi)
Adjust these bounds so that they are adjusted to the nearest scale in the provided set of scales.
|
MapBounds |
adjustBoundsToRotation(double rotation)
In case a rotation is used for the map, the bounds have to be adjusted so that all visible parts are
rendered.
|
MapBounds |
adjustedEnvelope(java.awt.Rectangle paintArea)
Create a
ReferencedEnvelope representing the bounds. |
boolean |
equals(java.lang.Object o) |
MapBounds |
expand(int margin,
java.awt.Rectangle paintArea)
Expand the bounds by the given margin (in pixel).
|
com.vividsolutions.jts.geom.Coordinate |
getCenter()
Get the center.
|
Scale |
getScale(java.awt.Rectangle paintArea,
double dpi)
Calculate and return the scale of the map bounds.
|
int |
hashCode() |
org.geotools.geometry.jts.ReferencedEnvelope |
toReferencedEnvelope(java.awt.Rectangle paintArea)
Create a
ReferencedEnvelope representing the bounds. |
java.lang.String |
toString() |
MapBounds |
zoomOut(double factor)
Zooms-out the bounds by the given factor.
|
MapBounds |
zoomToScale(Scale scale)
Zoom to the given scale.
|
getNearestScale, getProjectionpublic BBoxMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
com.vividsolutions.jts.geom.Envelope envelope)
projection - the projection these bounds are defined in.envelope - the boundspublic BBoxMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double minX,
double minY,
double maxX,
double maxY)
projection - the projection these bounds are defined in.minX - min X coordinate for the MapBoundsminY - min Y coordinate for the MapBoundsmaxX - max X coordinate for the MapBoundsmaxY - max Y coordinate for the MapBoundspublic BBoxMapBounds(org.geotools.geometry.jts.ReferencedEnvelope bbox)
bbox - the bounds.public org.geotools.geometry.jts.ReferencedEnvelope toReferencedEnvelope(java.awt.Rectangle paintArea)
MapBoundsReferencedEnvelope representing the bounds.
toReferencedEnvelope in class MapBoundspaintArea - the size of the map that will be drawn (at 72 DPI).public MapBounds adjustedEnvelope(java.awt.Rectangle paintArea)
MapBoundsReferencedEnvelope representing the bounds.
adjustedEnvelope in class MapBoundspaintArea - the size of the map that will be drawn.public MapBounds adjustBoundsToNearestScale(ZoomLevels zoomLevels, double tolerance, ZoomLevelSnapStrategy zoomLevelSnapStrategy, boolean geodetic, java.awt.Rectangle paintArea, double dpi)
MapBoundsThe center should remain the same and the scale should be adjusted
adjustBoundsToNearestScale in class MapBoundszoomLevels - the list of Zoom Levelstolerance - the tolerance to use when considering if two values are equal. For example if
12.0 == 12.001. The tolerance is a percentagezoomLevelSnapStrategy - the strategy to use for snapping to the nearest zoom level.geodetic - snap to geodetic scales.paintArea - the paint area of the map.dpi - the DPI.public Scale getScale(java.awt.Rectangle paintArea, double dpi)
MapBoundspublic MapBounds adjustBoundsToRotation(double rotation)
MapBoundsadjustBoundsToRotation in class MapBoundsrotation - The rotation of the map in radians.public MapBounds zoomOut(double factor)
MapBoundspublic MapBounds zoomToScale(Scale scale)
MapBoundszoomToScale in class MapBoundsscale - The new scale.public com.vividsolutions.jts.geom.Coordinate getCenter()
MapBoundspublic MapBounds expand(int margin, java.awt.Rectangle paintArea)
margin - Value in pixel.paintArea - the paint area of the map.public java.lang.String toString()
toString in class java.lang.Object