public final class MapfishMapContext
extends java.lang.Object
AffineTransform to render the layer graphics.| Constructor and Description |
|---|
MapfishMapContext(MapBounds bounds,
java.awt.Dimension mapSize,
double rotationInDegree,
double dpi,
double requestorDpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
MapfishMapContext(MapfishMapContext parent,
MapBounds bounds,
java.awt.Dimension mapSize,
double rotation,
boolean rotationInDegree,
double dpi,
double requestorDpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
MapfishMapContext(MapfishMapContext parent,
MapBounds bounds,
java.awt.Dimension mapSize,
double rotationInDegree,
double dpi,
double requestorDpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MapBounds |
getBounds() |
double |
getDPI() |
Scale |
getGeodeticScale() |
java.awt.Dimension |
getMapSize() |
java.awt.Rectangle |
getPaintArea() |
MapfishMapContext |
getParentContext()
Get the parent context if there is one.
|
double |
getRequestorDPI() |
MapfishMapContext |
getRootContext()
Return the root context which is this context or the context found by recursively calling parent.getRootContext().
|
MapBounds |
getRotatedBounds()
Return the map bounds rotated with the set rotation.
|
MapBounds |
getRotatedBounds(java.awt.geom.Rectangle2D.Double paintAreaPrecise,
java.awt.Rectangle paintArea)
Return the map bounds rotated with the set rotation.
|
java.awt.Dimension |
getRotatedMapSize() |
java.awt.geom.Rectangle2D.Double |
getRotatedMapSizePrecise() |
double |
getRotation() |
double |
getRoundedScale()
Get a nicely rounded scale for to use for displaying the map scale.
|
double |
getRoundedScale(boolean geodetic)
Get a nicely rounded scale for to use for displaying the map scale.
|
Scale |
getScale() |
java.awt.geom.AffineTransform |
getTransform()
Returns an
AffineTransform taking the rotation into account. |
java.lang.Boolean |
isDpiSensitiveStyle() |
java.lang.Boolean |
isForceLongitudeFirst() |
static java.awt.Dimension |
rectangleDoubleToDimension(java.awt.geom.Rectangle2D.Double rectangle)
Round the size of a rectangle with double values.
|
org.geotools.geometry.jts.ReferencedEnvelope |
toReferencedEnvelope()
Get the bounds as a referenced envelope.
|
public MapfishMapContext(MapBounds bounds, java.awt.Dimension mapSize, double rotationInDegree, double dpi, double requestorDpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
bounds - the map boundsmapSize - the map sizerotationInDegree - the rotation in degreedpi - the dpi of the printed maprequestorDpi - the dpi of the client mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public MapfishMapContext(MapfishMapContext parent, MapBounds bounds, java.awt.Dimension mapSize, double rotationInDegree, double dpi, double requestorDpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
parent - the context that this context is derived frombounds - the map boundsmapSize - the map sizerotationInDegree - the rotation in degreedpi - the dpi of the printed maprequestorDpi - the dpi of the client mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public MapfishMapContext(MapfishMapContext parent, MapBounds bounds, java.awt.Dimension mapSize, double rotation, boolean rotationInDegree, double dpi, double requestorDpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
parent - the context that this context is derived frombounds - the map boundsmapSize - the map sizerotation - the rotationrotationInDegree - the rotation in degree?dpi - the dpi of the printed maprequestorDpi - the dpi of the client mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public double getRotation()
public MapBounds getBounds()
public MapBounds getRotatedBounds()
public MapBounds getRotatedBounds(java.awt.geom.Rectangle2D.Double paintAreaPrecise, java.awt.Rectangle paintArea)
paintAreaPrecise - The exact size of the paint area.paintArea - The rounded size of the paint area.public java.awt.Dimension getMapSize()
public Scale getScale()
public Scale getGeodeticScale()
public double getRoundedScale()
One of the output parameters of the CreateMapProcessor is 'mapContext' which can
be accessed in a template. If the scale is required in the template then it can be accessed via:
$P{mapContext}.getRoundedScale()
public double getRoundedScale(boolean geodetic)
One of the output parameters of the CreateMapProcessor is 'mapContext' which can
be accessed in a template. If the scale is required in the template then it can be accessed via:
$P{mapContext}.getRoundedScale()
geodetic - Get geodetic scalepublic java.awt.Dimension getRotatedMapSize()
public java.awt.geom.Rectangle2D.Double getRotatedMapSizePrecise()
public static java.awt.Dimension rectangleDoubleToDimension(java.awt.geom.Rectangle2D.Double rectangle)
rectangle - The rectangle.public java.awt.geom.AffineTransform getTransform()
AffineTransform taking the rotation into account.public double getDPI()
public double getRequestorDPI()
public java.awt.Rectangle getPaintArea()
@Nullable public java.lang.Boolean isForceLongitudeFirst()
public java.lang.Boolean isDpiSensitiveStyle()
public org.geotools.geometry.jts.ReferencedEnvelope toReferencedEnvelope()
@Nullable public MapfishMapContext getParentContext()
@Nonnull public MapfishMapContext getRootContext()