Package org.mapfish.print.attribute.map
Class GenericMapAttribute.GenericMapAttributeValues
java.lang.Object
org.mapfish.print.attribute.map.GenericMapAttribute.GenericMapAttributeValues
- Direct Known Subclasses:
MapAttribute.MapAttributeValues
,OverviewMapAttribute.OverviewMapAttributeValues
- Enclosing class:
- GenericMapAttribute
The value of
GenericMapAttribute
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The default projection.boolean
Should the vector style definitions be adapted to the target DPI resolution? (Default: true)The height of the map.By default the normal axis order as specified in EPSG code will be used when parsing projections.Whether to merge all layers into one.The projection of the map.The rotation of the map.Indicates if the map should adjust its bounds.Indicates if the map should adjust its scale/zoom level to be equal to one of those defined in the configuration file.The width of the map. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GenericMapAttributeValues
(Template template) Constructor.protected
GenericMapAttributeValues
(Template template, Integer width, Integer height) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract Double
getDpi()
Return the DPI value for the map.double[]
final Integer
final Dimension
abstract PArray
Return the JSON layer definition.Gets the rotation.final Template
protected final <T> T
getValueOr
(T value, T defaultValue) final Integer
getWidth()
final boolean
Return true if requestData has useNearestScale and configuration has some zoom levels defined.Return true if requestData has useNearestScale and configuration has some zoom levels defined.protected final org.geotools.api.referencing.crs.CoordinateReferenceSystem
Parse the projection from a string.void
Validate the values provided by the request data and construct MapBounds and parse the layers.void
replaceLayer
(int pos, MapLayer layer) Replace a layer with another.abstract void
setRawLayers
(PArray layers) Set the JSON layer definition.
-
Field Details
-
DEFAULT_PROJECTION
The default projection.- See Also:
-
width
The width of the map. -
height
The height of the map. -
projection
The projection of the map. -
rotation
The rotation of the map. -
useNearestScale
Indicates if the map should adjust its scale/zoom level to be equal to one of those defined in the configuration file.- See Also:
-
useAdjustBounds
Indicates if the map should adjust its bounds.- See Also:
-
longitudeFirst
By default the normal axis order as specified in EPSG code will be used when parsing projections. However the requester can override this by explicitly declaring that longitude axis is first. -
dpiSensitiveStyle
public boolean dpiSensitiveStyleShould the vector style definitions be adapted to the target DPI resolution? (Default: true)The style definitions are often optimized for a use with OpenLayers (which uses a DPI value of 72). When these styles are used to print with a higher DPI value, lines often look too thin, label are too small, etc.
If this property is set to `true`, the style definitions will be scaled to the target DPI value.
-
pdfA
Whether to merge all layers into one. This is great to reduce pdf size but needs layers having an imagebufferscaling of 1. Also see the pdfA option of the print config.
-
-
Constructor Details
-
GenericMapAttributeValues
Constructor.- Parameters:
template
- the template this map is part of.
-
GenericMapAttributeValues
Constructor.- Parameters:
template
- the template this map is part of.width
- the width of the map.height
- the height of the map.
-
-
Method Details
-
postConstruct
public void postConstruct() throws org.geotools.api.referencing.FactoryExceptionValidate the values provided by the request data and construct MapBounds and parse the layers.- Throws:
org.geotools.api.referencing.FactoryException
-
parseProjection
protected final org.geotools.api.referencing.crs.CoordinateReferenceSystem parseProjection()Parse the projection from a string.- Returns:
- the crs
-
getDpi
Return the DPI value for the map. This method is abstract because the dpi value is optional for the overview map, but must be given for the normal map. So, in the overview map the field is defined with a @HasDefaultValue annotation. -
getRawLayers
Return the JSON layer definition. This method is abstract for the same reasons asgetDpi()
. -
setRawLayers
Set the JSON layer definition. This method is abstract for the same reasons asgetDpi()
.- Parameters:
layers
- the new layers
-
getLayers
-
replaceLayer
Replace a layer with another.- Parameters:
pos
- The position of the layer to replacelayer
- The new layer
-
getTemplate
-
getMapSize
-
getWidth
-
getHeight
-
getRotation
Gets the rotation.- Returns:
- the rotation
-
getProjection
-
isUseNearestScale
Return true if requestData has useNearestScale and configuration has some zoom levels defined. -
isUseAdjustBounds
Return true if requestData has useNearestScale and configuration has some zoom levels defined. -
isDpiSensitiveStyle
public final boolean isDpiSensitiveStyle() -
getZoomLevels
-
getZoomSnapTolerance
-
getZoomLevelSnapStrategy
-
getZoomSnapGeodetic
-
getDpiSuggestions
public double[] getDpiSuggestions() -
getValueOr
protected final <T> T getValueOr(T value, T defaultValue) - Type Parameters:
T
- A type.- Parameters:
value
- The value or null.defaultValue
- The default value.
-