Class GenericMapAttribute

All Implemented Interfaces:
Attribute, ConfigurationObject
Direct Known Subclasses:
MapAttribute, OverviewMapAttribute

public abstract class GenericMapAttribute extends ReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
  • Field Details

    • JSON_DPI_SUGGESTIONS

      public static final String JSON_DPI_SUGGESTIONS
      The json key for the suggested DPI values in the client config.
      See Also:
    • JSON_MAX_DPI

      public static final String JSON_MAX_DPI
      The json key for the max DPI value in the client config.
      See Also:
    • JSON_MAP_WIDTH

      public static final String JSON_MAP_WIDTH
      The json key for the width of the map in the client config.
      See Also:
    • JSON_MAP_HEIGHT

      public static final String JSON_MAP_HEIGHT
      The json key for the height of the map in the client config.
      See Also:
    • JSON_MAX_WIDTH

      public static final String JSON_MAX_WIDTH
      The json key for the max width of the map in the client config (for mapExport).
      See Also:
    • JSON_MAX_HEIGHT

      public static final String JSON_MAX_HEIGHT
      The json key for the max height of the map in the client config (for mapExport).
      See Also:
  • Constructor Details

    • GenericMapAttribute

      public GenericMapAttribute()
  • Method Details

    • parseProjection

      public static org.geotools.api.referencing.crs.CoordinateReferenceSystem parseProjection(String projection, Boolean longitudeFirst)
      Parse the given projection.
      Parameters:
      projection - The projection string.
      longitudeFirst - longitudeFirst
    • getMaxDpi

      public final Double getMaxDpi()
    • setMaxDpi

      public final void setMaxDpi(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 Integer getWidth()
    • setWidth

      public final void setWidth(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 Integer getHeight()
    • setHeight

      public final void setHeight(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 Integer getMaxWidth()
    • setMaxWidth

      public final void setMaxWidth(Integer maxWidth)
      Limits the maximum width of the map.
      Parameters:
      maxWidth - the value
    • getMaxHeight

      public final Integer getMaxHeight()
    • setMaxHeight

      public final void setMaxHeight(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(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:
    • setZoomSnapGeodetic

      public final void setZoomSnapGeodetic(Boolean zoomSnapGeodetic)
      If true, snap to geodetic scales.
      Parameters:
      zoomSnapGeodetic - the value
    • validate

      public void validate(List<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 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 class ReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
      Throws:
      org.json.JSONException