Package org.mapfish.print.attribute.map
Class MapAttribute.MapAttributeValues
- java.lang.Object
-
- org.mapfish.print.attribute.map.GenericMapAttribute.GenericMapAttributeValues
-
- org.mapfish.print.attribute.map.MapAttribute.MapAttributeValues
-
- Direct Known Subclasses:
MapAttribute.OverriddenMapAttributeValues
- Enclosing class:
- MapAttribute
public class MapAttribute.MapAttributeValues extends GenericMapAttribute.GenericMapAttributeValues
The value ofMapAttribute
.
-
-
Field Summary
Fields Modifier and Type Field Description AreaOfInterest
areaOfInterest
A GeoJSON geometry that is essentially the area of the area to draw on the map.double[]
bbox
An array of 4 doubles, minX, minY, maxX, maxY.double[]
center
An array of 2 doubles, (x, y).double
dpi
The output dpi of the printed map.PArray
layers
The json with all the layer information.java.lang.Double
scale
If center is defined then this is the scale of the map centered at center.ZoomToFeatures
zoomToFeatures
Zoom the map to the features of a specific layer or all features of the map.-
Fields inherited from class org.mapfish.print.attribute.map.GenericMapAttribute.GenericMapAttributeValues
DEFAULT_PROJECTION, dpiSensitiveStyle, height, longitudeFirst, pdfA, projection, rotation, useAdjustBounds, useNearestScale, width
-
-
Constructor Summary
Constructors Constructor Description MapAttributeValues(Template template)
Constructor.MapAttributeValues(Template template, java.lang.Integer width, java.lang.Integer height)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapAttribute.MapAttributeValues
copy(int width, int height, java.util.function.Function<MapAttribute.MapAttributeValues,java.lang.Void> updater)
Create a copy of this instance.java.lang.Double
getDpi()
Return the DPI value for the map.MapBounds
getMapBounds()
java.lang.String
getProjection()
PArray
getRawLayers()
Return the JSON layer definition.java.lang.Double
getRotation()
Gets the rotation.MapAttribute.OverriddenMapAttributeValues
getWithOverrides(OverviewMapAttribute.OverviewMapAttributeValues paramOverrides)
Creates anMapAttribute.OverriddenMapAttributeValues
instance with the current object and a givenOverviewMapAttribute.OverviewMapAttributeValues
instance.ZoomLevelSnapStrategy
getZoomLevelSnapStrategy()
java.lang.Boolean
getZoomSnapGeodetic()
java.lang.Double
getZoomSnapTolerance()
java.lang.Boolean
isUseAdjustBounds()
Return true if requestData has useNearestScale and configuration has some zoom levels defined.java.lang.Boolean
isUseNearestScale()
Return true if requestData has useNearestScale and configuration has some zoom levels defined.void
postConstruct()
Validate the values provided by the request data and construct MapBounds and parse the layers.void
recalculateBounds()
Recalculate the bounds after center or bounds have changed.void
setMapBounds(MapBounds mapBounds)
void
setRawLayers(PArray newLayers)
Set the JSON layer definition.-
Methods inherited from class org.mapfish.print.attribute.map.GenericMapAttribute.GenericMapAttributeValues
getDpiSuggestions, getHeight, getLayers, getMapSize, getTemplate, getValueOr, getWidth, getZoomLevels, isDpiSensitiveStyle, parseProjection, replaceLayer
-
-
-
-
Field Detail
-
bbox
public double[] bbox
An array of 4 doubles, minX, minY, maxX, maxY. The bounding box of the map.Either the bbox or the center + scale must be defined
-
areaOfInterest
public AreaOfInterest areaOfInterest
A GeoJSON geometry that is essentially the area of the area to draw on the map.
-
center
public double[] center
An array of 2 doubles, (x, y). The center of the map.
-
scale
public java.lang.Double scale
If center is defined then this is the scale of the map centered at center.
-
zoomToFeatures
public ZoomToFeatures zoomToFeatures
Zoom the map to the features of a specific layer or all features of the map.
-
layers
public PArray layers
The json with all the layer information. This will be parsed in postConstruct into a list of layers and therefore this field should not normally be accessed.The first layer in the array will be the top layer in the map. The last layer in the array will be the bottom layer in the map. There for the last layer will be hidden by the first layer (where not transparent).
-
dpi
public double dpi
The output dpi of the printed map.
-
-
Constructor Detail
-
MapAttributeValues
public MapAttributeValues(Template template, java.lang.Integer width, java.lang.Integer height)
Constructor.- Parameters:
template
- the template this map is part of.width
- the width of the map.height
- the height of the map.
-
MapAttributeValues
public MapAttributeValues(Template template)
Constructor.- Parameters:
template
- the template this map is part of.
-
-
Method Detail
-
getDpi
public java.lang.Double getDpi()
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
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.- Specified by:
getDpi
in classGenericMapAttribute.GenericMapAttributeValues
-
getRawLayers
public final PArray getRawLayers()
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Return the JSON layer definition. This method is abstract for the same reasons asGenericMapAttribute.GenericMapAttributeValues.getDpi()
.- Specified by:
getRawLayers
in classGenericMapAttribute.GenericMapAttributeValues
-
setRawLayers
public void setRawLayers(PArray newLayers)
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Set the JSON layer definition. This method is abstract for the same reasons asGenericMapAttribute.GenericMapAttributeValues.getDpi()
.- Specified by:
setRawLayers
in classGenericMapAttribute.GenericMapAttributeValues
- Parameters:
newLayers
- the new layers
-
postConstruct
public final void postConstruct() throws org.geotools.api.referencing.FactoryException
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Validate the values provided by the request data and construct MapBounds and parse the layers.- Overrides:
postConstruct
in classGenericMapAttribute.GenericMapAttributeValues
- Throws:
org.geotools.api.referencing.FactoryException
-
getMapBounds
public MapBounds getMapBounds()
-
setMapBounds
public void setMapBounds(MapBounds mapBounds)
-
recalculateBounds
public void recalculateBounds()
Recalculate the bounds after center or bounds have changed.
-
getProjection
public java.lang.String getProjection()
- Overrides:
getProjection
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapTolerance
public java.lang.Double getZoomSnapTolerance()
- Overrides:
getZoomSnapTolerance
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomLevelSnapStrategy
public ZoomLevelSnapStrategy getZoomLevelSnapStrategy()
- Overrides:
getZoomLevelSnapStrategy
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapGeodetic
public java.lang.Boolean getZoomSnapGeodetic()
- Overrides:
getZoomSnapGeodetic
in classGenericMapAttribute.GenericMapAttributeValues
-
getRotation
public java.lang.Double getRotation()
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Gets the rotation.- Overrides:
getRotation
in classGenericMapAttribute.GenericMapAttributeValues
- Returns:
- the rotation
-
isUseNearestScale
public java.lang.Boolean isUseNearestScale()
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Return true if requestData has useNearestScale and configuration has some zoom levels defined.- Overrides:
isUseNearestScale
in classGenericMapAttribute.GenericMapAttributeValues
-
isUseAdjustBounds
public java.lang.Boolean isUseAdjustBounds()
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Return true if requestData has useNearestScale and configuration has some zoom levels defined.- Overrides:
isUseAdjustBounds
in classGenericMapAttribute.GenericMapAttributeValues
-
getWithOverrides
public final MapAttribute.OverriddenMapAttributeValues getWithOverrides(OverviewMapAttribute.OverviewMapAttributeValues paramOverrides)
Creates anMapAttribute.OverriddenMapAttributeValues
instance with the current object and a givenOverviewMapAttribute.OverviewMapAttributeValues
instance.- Parameters:
paramOverrides
- Attributes set in this instance will override attributes in the current instance.
-
copy
public MapAttribute.MapAttributeValues copy(int width, int height, @Nonnull java.util.function.Function<MapAttribute.MapAttributeValues,java.lang.Void> updater)
Create a copy of this instance. Should be overridden for each subclass.- Parameters:
width
- the width of the new map attribute values to createheight
- the height of the new map attribute values to createupdater
- a function which will be called after copy is made but before postConstruct is called in order to do other configuration changes.
-
-