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).doubleThe 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 PArrayReturn the JSON layer definition.Gets the rotation.getWithOverrides(OverviewMapAttribute.OverviewMapAttributeValues paramOverrides) Creates anMapAttribute.OverriddenMapAttributeValuesinstance with the current object and a givenOverviewMapAttribute.OverviewMapAttributeValuesinstance.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 voidValidate the values provided by the request data and construct MapBounds and parse the layers.voidRecalculate the bounds after center or bounds have changed.voidsetMapBounds(MapBounds mapBounds) voidsetPagingOverviewLayer(MapLayer newPagingOverviewLayer) voidsetRawLayers(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.GenericMapAttributeValuesReturn 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:
getDpiin classGenericMapAttribute.GenericMapAttributeValues
-
getRawLayers
Description copied from class:GenericMapAttribute.GenericMapAttributeValuesReturn the JSON layer definition. This method is abstract for the same reasons asGenericMapAttribute.GenericMapAttributeValues.getDpi().- Specified by:
getRawLayersin classGenericMapAttribute.GenericMapAttributeValues
-
setRawLayers
Description copied from class:GenericMapAttribute.GenericMapAttributeValuesSet the JSON layer definition. This method is abstract for the same reasons asGenericMapAttribute.GenericMapAttributeValues.getDpi().- Specified by:
setRawLayersin classGenericMapAttribute.GenericMapAttributeValues- Parameters:
newLayers- the new layers
-
setPagingOverviewLayer
-
getPagingOverviewLayer
-
postConstruct
public final void postConstruct() throws org.geotools.api.referencing.FactoryExceptionDescription copied from class:GenericMapAttribute.GenericMapAttributeValuesValidate the values provided by the request data and construct MapBounds and parse the layers.- Overrides:
postConstructin 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:
getProjectionin classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapTolerance
- Overrides:
getZoomSnapTolerancein classGenericMapAttribute.GenericMapAttributeValues
-
getZoomLevelSnapStrategy
- Overrides:
getZoomLevelSnapStrategyin classGenericMapAttribute.GenericMapAttributeValues
-
getZoomSnapGeodetic
- Overrides:
getZoomSnapGeodeticin classGenericMapAttribute.GenericMapAttributeValues
-
getRotation
Description copied from class:GenericMapAttribute.GenericMapAttributeValuesGets the rotation.- Overrides:
getRotationin classGenericMapAttribute.GenericMapAttributeValues- Returns:
- the rotation
-
isUseNearestScale
Description copied from class:GenericMapAttribute.GenericMapAttributeValuesReturn true if requestData has useNearestScale and configuration has some zoom levels defined.- Overrides:
isUseNearestScalein classGenericMapAttribute.GenericMapAttributeValues
-
isUseAdjustBounds
Description copied from class:GenericMapAttribute.GenericMapAttributeValuesReturn true if requestData has useNearestScale and configuration has some zoom levels defined.- Overrides:
isUseAdjustBoundsin classGenericMapAttribute.GenericMapAttributeValues
-
getWithOverrides
public final MapAttribute.OverriddenMapAttributeValues getWithOverrides(OverviewMapAttribute.OverviewMapAttributeValues paramOverrides) Creates anMapAttribute.OverriddenMapAttributeValuesinstance with the current object and a givenOverviewMapAttribute.OverviewMapAttributeValuesinstance.- 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.
-