com.supermap.mapping

Class LayerSettingImage



  • public class LayerSettingImage
    extends LayerSetting
    Rhithers. Decision Rhitherges Rhithers. Rhitherite Rhithers. Rhitherite Rhitherd Rhithers. Rhither Rh.

    This class is mainly used to set the display style of the image layer, to obtain and set the image layer transparent background color, transparent color tolerance and whether to allow transparent features. Image layer corresponds to normal layer. It is style setting instance can be acquired from Layer.getAdditionalSetting(). You can also create a new object and set through the Layer.setAdditionalSetting(LayerSetting) method. After modifying the layer display, you need to call the methodMap.refresh()to refresh the map.

    • Constructor Detail

      • LayerSettingImage

        public LayerSettingImage()
        Initializes a new instance of this LayerSettingImage class.
      • LayerSettingImage

        public LayerSettingImage(LayerSettingImage layerSettingImage)
        Constructor. Constructs a new instance according to the specified LayerSettingImage object.
        Parameters:
        layerSettingImage - Specifies the LayerSettingImage object
    • Method Detail

      • isTransparent

        public boolean isTransparent()
        Whether the background color of the image layer is transparently displayed or not. True indicates the color specified by setTransparentColor(Color) will transparently display. Default is false, indicating not transparent.
        Returns:
        Returns an opolean indicating whether the image layer background is transparent
      • setTransparent

        public void setTransparent(boolean transparentEnable)
        Sets whether the background color of the image layer is transparently displayed or not.
        Parameters:
        transparentEnable - boolean type, indicating whether the image layer background color is transparent. True indicates the color specified by setTransparentColor(Color) will transparently display.
      • getTransparentColor

        public Color getTransparentColor()
        Gets the transparent background color.
        Returns:
        ColorType, returns the specified transparent background color. If the object is a new one, returns null.
      • setTransparentColor

        public void setTransparentColor(Color color)
        Sets whether the image layer needs to transparently display the background color or not.

        In addition to the need to transparently display the color, but also need thesetTransparent(boolean)to allow transparent display of the color

        Parameters:
        color - ColorType, background color that needs to be displayed transparently
      • getTransparentColorTolerance

        public int getTransparentColorTolerance()
        Gets the tolerance for transparent background color.

        Transparent tolerance range is [0,255]. When this value is 0, only the specified color can be transparently displayed; when the value is 255, all colors will be displayed transparently. The default value is 0.

        Returns:
        int type, returns the tolerance value of the current transparent background color
      • setTransparentColorTolerance

        public void setTransparentColorTolerance(int value)
        Sets the tolerance of transparent background color.

        Transparent tolerance range is [0,255]. When this value is 0, only the specified color can be transparently displayed; when the value is 255, all colors will be displayed transparently.

        This setting is valid if and only if theisTransparent()value is true.

        Parameters:
        value - int type, you need to set the transparent background color and color limits. If value<0, the real setting would be 0; if value >255, the real value is 255.
      • getAllSubLayers

        public java.lang.String[] getAllSubLayers()
        Gets the collection of all layers and return the string array.
        Returns:
        Layer name collection.
      • getVisibleSubLayers

        public java.lang.String[] getVisibleSubLayers()
        Gets the collection of all visible layers and return the string array.
        Returns:
        Layer name collection
      • setVisibleSubLayers

        public void setVisibleSubLayers(java.lang.String[] subLayers)
        Sets the collection of all visible layers.
        Parameters:
        subLayers - Layer name collection.
      • setMapLayersID

        public void setMapLayersID(java.lang.String layersID)
        Sets layer collection specified by map (for REST services).
        Parameters:
        layersID - Specifies the ID of the layer collection.
      • getMapLayersID

        public java.lang.String getMapLayersID()
        Gets layer collection specified by map (for REST services).
        Returns:
        Map Specifies the collection of layers.
      • getDisplayBandIndexes

        public int[] getDisplayBandIndexes()
        Gets the band index of the current image layer
        Returns:
        Returns the band index displayed by the current image layer
      • setDisplayBandIndexes

        public void setDisplayBandIndexes(int[] bandIndexes)
        Sets the band index displayed by current image layer. Supposes it has several bands, when you need to set the display band according to the set color mode (such as RGB) Specify the color (such as red, green, blue) in the corresponding band index (such as 0,2,1) can be.
        Parameters:
        bandIndexes - The current image layer shows the band index
      • getDisplayMode

        public ImageDisplayMode getDisplayMode()
        Returns the image display mode
        Returns:
        image display mode Defaults: The default value is consistent with the number of bands in the data set. If the data set is multi-band, the default is the combined mode. Otherwise, the default is the stretching mode.
      • setDisplayMode

        public void setDisplayMode(ImageDisplayMode displayMode)
        Set the image display mode
        Parameters:
        displayMode - image display mode, multi-band support two display modes, single band only supports stretch display mode
      • getDisplayColorSpace

        public ColorSpaceType getDisplayColorSpace()
        Gets the color display mode of the image layer
        Returns:
        image layer color display mode, the default is RGB
      • setDisplayColorSpace

        public void setDisplayColorSpace(ColorSpaceType colorSpace)
        Sets the color display mode for the image layer. It displays the image layer in the color mode according to the current color format of the image layer and the displayed band. Currently only support RGB / RGBA two
        Parameters:
        colorSpace - The color display mode of the image layer
      • getImageStretchOption

        public ImageStretchOption getImageStretchOption()
        Get image stretch parameters If there is a color table, and the number of color table is not 0, will use the color table to display the image, then the drawing method does not work, If there is no color table or the number is 0, support the stretch display.
        Returns:
        ImageStretchOption Image stretch parameters
      • setImageStretchOption

        public void setImageStretchOption(ImageStretchOption imageStretchOption)
        Set stretching way for the multi-band image of the layer
        Parameters:
        imageStretchOption - Stretch parameters
      • add

        public void add(Datasource datasource,
                        java.lang.String strSLDFilePath)
        Add a layer to the layer collection through the SLD file
        Parameters:
        datasource - The data source where the data is located
        strSLDFilePath - SLD file path
      • setCacheMaxSize

        public void setCacheMaxSize(int nMaxSize)
        Sets the maximum number of buffers for the layer
        Parameters:
        nMaxSize - Maximum number of buffers
      • getCacheMaxSize

        public int getCacheMaxSize()
        Gets the maximum number of buffers for the layer
        Returns:
        maximum number of buffers