Class GenericMapAttribute.GenericMapAttributeValues

java.lang.Object
org.mapfish.print.attribute.map.GenericMapAttribute.GenericMapAttributeValues
Direct Known Subclasses:
MapAttribute.MapAttributeValues, OverviewMapAttribute.OverviewMapAttributeValues
Enclosing class:
GenericMapAttribute

public abstract class GenericMapAttribute.GenericMapAttributeValues extends Object
The value of GenericMapAttribute.
  • Field Details

    • DEFAULT_PROJECTION

      protected static final String DEFAULT_PROJECTION
      The default projection.
      See Also:
    • width

      public Integer width
      The width of the map.
    • height

      public Integer height
      The height of the map.
    • projection

      public String projection
      The projection of the map.
    • rotation

      public Double rotation
      The rotation of the map.
    • useNearestScale

      public Boolean useNearestScale
      Indicates if the map should adjust its scale/zoom level to be equal to one of those defined in the configuration file.
      See Also:
    • useAdjustBounds

      public Boolean useAdjustBounds
      Indicates if the map should adjust its bounds.
      See Also:
    • longitudeFirst

      public Boolean longitudeFirst
      By default the normal axis order as specified in EPSG code will be used when parsing projections. However the requester can override this by explicitly declaring that longitude axis is first.
    • dpiSensitiveStyle

      public boolean dpiSensitiveStyle
      Should the vector style definitions be adapted to the target DPI resolution? (Default: true)

      The style definitions are often optimized for a use with OpenLayers (which uses a DPI value of 72). When these styles are used to print with a higher DPI value, lines often look too thin, label are too small, etc.

      If this property is set to `true`, the style definitions will be scaled to the target DPI value.

    • pdfA

      public Boolean pdfA
      Whether to merge all layers into one. This is great to reduce pdf size but needs layers having an imagebufferscaling of 1. Also see the pdfA option of the print config.
  • Constructor Details

    • GenericMapAttributeValues

      protected GenericMapAttributeValues(Template template)
      Constructor.
      Parameters:
      template - the template this map is part of.
    • GenericMapAttributeValues

      protected GenericMapAttributeValues(Template template, Integer width, Integer height)
      Constructor.
      Parameters:
      template - the template this map is part of.
      width - the width of the map.
      height - the height of the map.
  • Method Details

    • postConstruct

      public void postConstruct() throws org.geotools.api.referencing.FactoryException
      Validate the values provided by the request data and construct MapBounds and parse the layers.
      Throws:
      org.geotools.api.referencing.FactoryException
    • parseProjection

      protected final org.geotools.api.referencing.crs.CoordinateReferenceSystem parseProjection()
      Parse the projection from a string.
      Returns:
      the crs
    • getDpi

      public abstract Double getDpi()
      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.
    • getRawLayers

      public abstract PArray getRawLayers()
      Return the JSON layer definition. This method is abstract for the same reasons as getDpi().
    • setRawLayers

      public abstract void setRawLayers(PArray layers)
      Set the JSON layer definition. This method is abstract for the same reasons as getDpi().
      Parameters:
      layers - the new layers
    • getLayers

      public List<MapLayer> getLayers()
    • replaceLayer

      public void replaceLayer(int pos, MapLayer layer)
      Replace a layer with another.
      Parameters:
      pos - The position of the layer to replace
      layer - The new layer
    • getTemplate

      public final Template getTemplate()
    • getMapSize

      public final Dimension getMapSize()
    • getWidth

      public final Integer getWidth()
    • getHeight

      public final Integer getHeight()
    • getRotation

      public Double getRotation()
      Gets the rotation.
      Returns:
      the rotation
    • getProjection

      public String getProjection()
    • isUseNearestScale

      public Boolean isUseNearestScale()
      Return true if requestData has useNearestScale and configuration has some zoom levels defined.
    • isUseAdjustBounds

      public Boolean isUseAdjustBounds()
      Return true if requestData has useNearestScale and configuration has some zoom levels defined.
    • isDpiSensitiveStyle

      public final boolean isDpiSensitiveStyle()
    • getZoomLevels

      public ZoomLevels getZoomLevels()
    • getZoomSnapTolerance

      public Double getZoomSnapTolerance()
    • getZoomLevelSnapStrategy

      public ZoomLevelSnapStrategy getZoomLevelSnapStrategy()
    • getZoomSnapGeodetic

      public Boolean getZoomSnapGeodetic()
    • getDpiSuggestions

      public double[] getDpiSuggestions()
    • getValueOr

      protected final <T> T getValueOr(T value, T defaultValue)
      Type Parameters:
      T - A type.
      Parameters:
      value - The value or null.
      defaultValue - The default value.