Class GenericMapAttribute.GenericMapAttributeValues

    • Field Detail

      • DEFAULT_PROJECTION

        protected static final java.lang.String DEFAULT_PROJECTION
        The default projection.
        See Also:
        Constant Field Values
      • width

        public java.lang.Integer width
        The width of the map.
      • height

        public java.lang.Integer height
        The height of the map.
      • projection

        public java.lang.String projection
        The projection of the map.
      • rotation

        public java.lang.Double rotation
        The rotation of the map.
      • useNearestScale

        public java.lang.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:
        isUseNearestScale()
      • useAdjustBounds

        public java.lang.Boolean useAdjustBounds
        Indicates if the map should adjust its bounds.
        See Also:
        isUseAdjustBounds()
      • longitudeFirst

        public java.lang.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 java.lang.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 Detail

      • GenericMapAttributeValues

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

        protected GenericMapAttributeValues​(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.
    • Method Detail

      • 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 java.lang.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 java.util.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 java.awt.Dimension getMapSize()
      • getWidth

        public final java.lang.Integer getWidth()
      • getHeight

        public final java.lang.Integer getHeight()
      • getRotation

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

        public java.lang.String getProjection()
      • isUseNearestScale

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

        public java.lang.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 java.lang.Double getZoomSnapTolerance()
      • getZoomSnapGeodetic

        public java.lang.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.