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 forCreateMapProcessor
andCreateOverviewMapProcessor
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
GenericMapAttribute.GenericMapAttributeValues
The value ofGenericMapAttribute
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JSON_DPI_SUGGESTIONS
The json key for the suggested DPI values in the client config.static java.lang.String
JSON_MAP_HEIGHT
The json key for the height of the map in the client config.static java.lang.String
JSON_MAP_WIDTH
The json key for the width of the map in the client config.static java.lang.String
JSON_MAX_DPI
The json key for the max DPI value in the client config.static java.lang.String
JSON_MAX_HEIGHT
The json key for the max height of the map in the client config (for mapExport).static java.lang.String
JSON_MAX_WIDTH
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 Constructor Description GenericMapAttribute()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<org.json.JSONObject>
getClientInfo()
Return an object that will be added to the client config with the key clientInfo.double[]
getDpiSuggestions()
Get DPI suggestions.java.lang.Integer
getHeight()
java.lang.Double
getMaxDpi()
java.lang.Integer
getMaxHeight()
java.lang.Integer
getMaxWidth()
java.lang.Integer
getWidth()
static org.geotools.api.referencing.crs.CoordinateReferenceSystem
parseProjection(java.lang.String projection, java.lang.Boolean longitudeFirst)
Parse the given projection.void
setDpiSuggestions(double[] dpiSuggestions)
Suggestions for DPI values to use.void
setHeight(java.lang.Integer height)
The height of the map in pixels.void
setMaxDpi(java.lang.Double maxDpi)
The maximum DPI allowed for maps.void
setMaxHeight(java.lang.Integer maxHeight)
Limits the maximum height of the map.void
setMaxWidth(java.lang.Integer maxWidth)
Limits the maximum width of the map.void
setWidth(java.lang.Integer width)
The width of the map in pixels.void
setZoomLevels(ZoomLevels zoomLevels)
The list of Zoom Levels.void
setZoomLevelSnapStrategy(ZoomLevelSnapStrategy zoomLevelSnapStrategy)
The strategy to use to compute the actual zoom level to use.void
setZoomSnapGeodetic(java.lang.Boolean zoomSnapGeodetic)
If true, snap to geodetic scales.void
setZoomSnapTolerance(java.lang.Double zoomSnapTolerance)
The zoom level tolerance.void
validate(java.util.List<java.lang.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 Detail
-
JSON_DPI_SUGGESTIONS
public static final java.lang.String JSON_DPI_SUGGESTIONS
The json key for the suggested DPI values in the client config.- See Also:
- Constant Field Values
-
JSON_MAX_DPI
public static final java.lang.String JSON_MAX_DPI
The json key for the max DPI value in the client config.- See Also:
- Constant Field Values
-
JSON_MAP_WIDTH
public static final java.lang.String JSON_MAP_WIDTH
The json key for the width of the map in the client config.- See Also:
- Constant Field Values
-
JSON_MAP_HEIGHT
public static final java.lang.String JSON_MAP_HEIGHT
The json key for the height of the map in the client config.- See Also:
- Constant Field Values
-
JSON_MAX_WIDTH
public static final java.lang.String JSON_MAX_WIDTH
The json key for the max width of the map in the client config (for mapExport).- See Also:
- Constant Field Values
-
JSON_MAX_HEIGHT
public static final java.lang.String JSON_MAX_HEIGHT
The json key for the max height of the map in the client config (for mapExport).- See Also:
- Constant Field Values
-
-
Method Detail
-
parseProjection
public static org.geotools.api.referencing.crs.CoordinateReferenceSystem parseProjection(java.lang.String projection, java.lang.Boolean longitudeFirst)
Parse the given projection.- Parameters:
projection
- The projection string.longitudeFirst
- longitudeFirst
-
getMaxDpi
public final java.lang.Double getMaxDpi()
-
setMaxDpi
public final void setMaxDpi(java.lang.Double maxDpi)
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
public final java.lang.Integer getWidth()
-
setWidth
public final void setWidth(java.lang.Integer width)
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
public final java.lang.Integer getHeight()
-
setHeight
public final void setHeight(java.lang.Integer height)
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
public final java.lang.Integer getMaxWidth()
-
setMaxWidth
public final void setMaxWidth(java.lang.Integer maxWidth)
Limits the maximum width of the map.- Parameters:
maxWidth
- the value
-
getMaxHeight
public final java.lang.Integer getMaxHeight()
-
setMaxHeight
public final void setMaxHeight(java.lang.Integer maxHeight)
Limits the maximum height of the map.- Parameters:
maxHeight
- the value
-
setZoomLevels
public final void setZoomLevels(ZoomLevels zoomLevels)
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
public final void setZoomSnapTolerance(java.lang.Double zoomSnapTolerance)
The zoom level tolerance.Used in ZoomLevelSnapStrategy.HIGHER_SCALE and ZoomLevelSnapStrategy.LOWER_SCALE to specify the cutoff value.
- Parameters:
zoomSnapTolerance
- the value
-
setZoomLevelSnapStrategy
public final void setZoomLevelSnapStrategy(ZoomLevelSnapStrategy zoomLevelSnapStrategy)
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:
ZoomLevelSnapStrategy
-
setZoomSnapGeodetic
public final void setZoomSnapGeodetic(java.lang.Boolean zoomSnapGeodetic)
If true, snap to geodetic scales.- Parameters:
zoomSnapGeodetic
- the value
-
validate
public void validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
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
protected final java.util.Optional<org.json.JSONObject> getClientInfo() throws org.json.JSONException
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
-
-