public final class CenterScaleMapBounds extends MapBounds
| Constructor and Description |
|---|
CenterScaleMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double centerX,
double centerY,
double scaleDenominator)
Constructor.
|
CenterScaleMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double centerX,
double centerY,
Scale scale)
Constructor.
|
| 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) |
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() |
CenterScaleMapBounds |
zoomOut(double factor)
Zooms-out the bounds by the given factor.
|
MapBounds |
zoomToScale(Scale newScale)
Zoom to the given scale.
|
getNearestScale, getProjectionpublic CenterScaleMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double centerX,
double centerY,
double scaleDenominator)
projection - the projection these bounds are defined in.centerX - the x coordinate of the center point.centerY - the y coordinate of the center point.scaleDenominator - the scale denominator of the map.public CenterScaleMapBounds(org.opengis.referencing.crs.CoordinateReferenceSystem projection,
double centerX,
double centerY,
Scale scale)
projection - the projection these bounds are defined in.centerX - the x coordinate of the center point.centerY - the y coordinate of the center point.scale - the scale of the map.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 CenterScaleMapBounds zoomOut(double factor)
MapBoundspublic MapBounds zoomToScale(Scale newScale)
MapBoundszoomToScale in class MapBoundsnewScale - The new scale.public com.vividsolutions.jts.geom.Coordinate getCenter()
MapBoundspublic java.lang.String toString()
toString in class java.lang.Object