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
The value of
MapAttribute
.-
Field Summary
FieldsModifier and TypeFieldDescriptionA GeoJSON geometry that is essentially the area of the area to draw on the map.double[]
An array of 4 doubles, minX, minY, maxX, maxY.double[]
An array of 2 doubles, (x, y).double
The output dpi of the printed map.The json with all the layer information.If center is defined then this is the scale of the map centered at center.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
ConstructorsConstructorDescriptionMapAttributeValues
(Template template) Constructor.MapAttributeValues
(Template template, Integer width, Integer height) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy
(int width, int height, Function<MapAttribute.MapAttributeValues, Void> updater) Create a copy of this instance.getDpi()
Return the DPI value for the map.final PArray
Return the JSON layer definition.Gets the rotation.getWithOverrides
(OverviewMapAttribute.OverviewMapAttributeValues paramOverrides) Creates anMapAttribute.OverriddenMapAttributeValues
instance with the current object and a givenOverviewMapAttribute.OverviewMapAttributeValues
instance.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.final void
Validate the values provided by the request data and construct MapBounds and parse the layers.void
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 Details
-
bbox
public double[] bboxAn 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
A GeoJSON geometry that is essentially the area of the area to draw on the map. -
center
public double[] centerAn array of 2 doubles, (x, y). The center of the map. -
scale
If center is defined then this is the scale of the map centered at center. -
zoomToFeatures
Zoom the map to the features of a specific layer or all features of the map. -
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 dpiThe output dpi of the printed map.
-
-
Constructor Details
-
MapAttributeValues
Constructor.- Parameters:
template
- the template this map is part of.width
- the width of the map.height
- the height of the map.
-
MapAttributeValues
Constructor.- Parameters:
template
- the template this map is part of.
-
-
Method Details
-
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
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
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.FactoryExceptionDescription 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
-
setMapBounds
-
recalculateBounds
public void recalculateBounds()Recalculate the bounds after center or bounds have changed. -
getProjection
- Overrides:
getProjection
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapTolerance
- Overrides:
getZoomSnapTolerance
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomLevelSnapStrategy
- Overrides:
getZoomLevelSnapStrategy
in classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapGeodetic
- Overrides:
getZoomSnapGeodetic
in classGenericMapAttribute.GenericMapAttributeValues
-
getRotation
Description copied from class:GenericMapAttribute.GenericMapAttributeValues
Gets the rotation.- Overrides:
getRotation
in classGenericMapAttribute.GenericMapAttributeValues
- Returns:
- the rotation
-
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
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 Function<MapAttribute.MapAttributeValues, 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.
-