Package org.mapfish.print.attribute.map
Class GenericMapAttribute
java.lang.Object
org.mapfish.print.attribute.ReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
org.mapfish.print.attribute.map.GenericMapAttribute
- All Implemented Interfaces:
Attribute
,ConfigurationObject
- Direct Known Subclasses:
MapAttribute
,OverviewMapAttribute
public abstract class GenericMapAttribute
extends ReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
Generic attributes for
CreateMapProcessor
and CreateOverviewMapProcessor
.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The json key for the suggested DPI values in the client config.static final String
The json key for the height of the map in the client config.static final String
The json key for the width of the map in the client config.static final String
The json key for the max DPI value in the client config.static final String
The json key for the max height of the map in the client config (for mapExport).static final String
The json key for the max width of the map in the client config (for mapExport).Fields inherited from class org.mapfish.print.attribute.ReflectiveAttribute
JSON_ATTRIBUTE_DEFAULT, JSON_ATTRIBUTE_EMBEDDED_TYPE, JSON_ATTRIBUTE_IS_ARRAY, JSON_ATTRIBUTE_TYPE, JSON_CLIENT_INFO, JSON_CLIENT_PARAMS, JSON_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Optional<org.json.JSONObject>
Return an object that will be added to the client config with the key clientInfo.final double[]
Get DPI suggestions.final Integer
final Double
final Integer
final Integer
final Integer
getWidth()
static org.geotools.api.referencing.crs.CoordinateReferenceSystem
parseProjection
(String projection, Boolean longitudeFirst) Parse the given projection.final void
setDpiSuggestions
(double[] dpiSuggestions) Suggestions for DPI values to use.final void
The height of the map in pixels.final void
The maximum DPI allowed for maps.final void
setMaxHeight
(Integer maxHeight) Limits the maximum height of the map.final void
setMaxWidth
(Integer maxWidth) Limits the maximum width of the map.final void
The width of the map in pixels.final void
setZoomLevels
(ZoomLevels zoomLevels) The list of Zoom Levels.final void
setZoomLevelSnapStrategy
(ZoomLevelSnapStrategy zoomLevelSnapStrategy) The strategy to use to compute the actual zoom level to use.final void
setZoomSnapGeodetic
(Boolean zoomSnapGeodetic) If true, snap to geodetic scales.final void
setZoomSnapTolerance
(Double zoomSnapTolerance) The zoom level tolerance.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.Methods inherited from class org.mapfish.print.attribute.ReflectiveAttribute
createValue, getAttributeName, getDefaultValue, getValue, getValueType, printClientConfig, setConfigName, setDefault
-
Field Details
-
JSON_DPI_SUGGESTIONS
The json key for the suggested DPI values in the client config.- See Also:
-
JSON_MAX_DPI
The json key for the max DPI value in the client config.- See Also:
-
JSON_MAP_WIDTH
The json key for the width of the map in the client config.- See Also:
-
JSON_MAP_HEIGHT
The json key for the height of the map in the client config.- See Also:
-
JSON_MAX_WIDTH
The json key for the max width of the map in the client config (for mapExport).- See Also:
-
JSON_MAX_HEIGHT
The json key for the max height of the map in the client config (for mapExport).- See Also:
-
-
Constructor Details
-
GenericMapAttribute
public GenericMapAttribute()
-
-
Method Details
-
parseProjection
public static org.geotools.api.referencing.crs.CoordinateReferenceSystem parseProjection(String projection, Boolean longitudeFirst) Parse the given projection.- Parameters:
projection
- The projection string.longitudeFirst
- longitudeFirst
-
getMaxDpi
-
setMaxDpi
The maximum DPI allowed for maps.If a request is made with a higher DPI, the request fails.
- Parameters:
maxDpi
- the value
-
getDpiSuggestions
public final double[] getDpiSuggestions()Get DPI suggestions.- Returns:
- DPI suggestions
-
setDpiSuggestions
public final void setDpiSuggestions(double[] dpiSuggestions) Suggestions for DPI values to use. Typically these are used by the client to create a UI for a user.- Parameters:
dpiSuggestions
- DPI suggestions
-
getWidth
-
setWidth
The width of the map in pixels. This value should match the width of the sub-report in the JasperReport template.- Parameters:
width
- Width
-
getHeight
-
setHeight
The height of the map in pixels. This value should match the height of the sub-report in the JasperReport template.- Parameters:
height
- Height
-
getMaxWidth
-
setMaxWidth
Limits the maximum width of the map.- Parameters:
maxWidth
- the value
-
getMaxHeight
-
setMaxHeight
Limits the maximum height of the map.- Parameters:
maxHeight
- the value
-
setZoomLevels
The list of Zoom Levels.Depending on the zoomLevelSnapStrategy, this will be used to compute the actual zoom level of the map.
- Parameters:
zoomLevels
- the value
-
setZoomSnapTolerance
The zoom level tolerance.Used in ZoomLevelSnapStrategy.HIGHER_SCALE and ZoomLevelSnapStrategy.LOWER_SCALE to specify the cutoff value.
- Parameters:
zoomSnapTolerance
- the value
-
setZoomLevelSnapStrategy
The strategy to use to compute the actual zoom level to use.If you specify this value, you must set the zoomLevels as well.
Possible values are:
- CLOSEST_LOWER_SCALE_ON_TIE: Find the closest zoom level. If the targetScale is directly between two zoomLevels then the smaller/higher resolution scale will be chosen.
- CLOSEST_HIGHER_SCALE_ON_TIE: Find the closest zoom level. If the targetScale is directly between two zoomLevels then the larger/lower resolution scale will be chosen.
- HIGHER_SCALE: Always choose the zoom-level that is just higher than the target value.
- LOWER_SCALE: Always choose the zoom-level that is just lower than the target value.
- Parameters:
zoomLevelSnapStrategy
- the value- See Also:
-
setZoomSnapGeodetic
If true, snap to geodetic scales.- Parameters:
zoomSnapGeodetic
- the value
-
validate
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-
getClientInfo
Description copied from class:ReflectiveAttribute
Return an object that will be added to the client config with the key clientInfo.- Overrides:
getClientInfo
in classReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
- Throws:
org.json.JSONException
-