public class LayerSettingImage extends LayerSetting
LayerSettingImage, 影像图层设置类。
该类主要用于设置影像图层的显示风格,获取和设置影像图层的透明背景色、透明色的容限和是否允许透明等特性。
影像数据只对应普通图层,其风格设置实例可以通过Layer.getAdditionalSetting()来获得;
也可以新创建一个对象, 通过Layer.setAdditionalSetting(LayerSetting)方法来设置。
在修改图层显示效果后,需要调用Map.refresh()方法来刷新地图。
| 构造器和说明 |
|---|
LayerSettingImage()
默认构造函数,构造一个新的 LayerSettingImage 对象
|
LayerSettingImage(LayerSettingImage layerSettingImage)
构造函数, 根据指定的LayerSettingImage对象,构造一个新的实例,新实例时传入对象的一个拷贝。
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(Datasource datasource,
java.lang.String strSLDFilePath)
通过SLD文件,向图层集合中添加图层
|
java.lang.String[] |
getAllSubLayers()
获取所有图层的集合,返回字符串数组。
|
int |
getCacheMaxSize()
获取图层的最大缓存数
|
int[] |
getDisplayBandIndexes()
获取当前影像图层的波段索引
|
ColorSpaceType |
getDisplayColorSpace()
获取影像图层的色彩显示模式
|
ImageDisplayMode |
getDisplayMode()
返回影像显示模式
|
ImageStretchOption |
getImageStretchOption()
获取影像拉伸参数
如果存在颜色表,且颜色表的数量不为0,则会使用颜色表显示影像,此时拉伸方式均不起作用,
如果没有颜色表或者数量为0,则支持拉伸显示。
|
java.lang.String |
getMapLayersID()
获取地图指定图层集合(针对Rest服务).
|
Color |
getTransparentColor()
获取当前指定的透明背景色
|
int |
getTransparentColorTolerance()
获取当前透明背景色的容限值
透明容限值范围为[0,255],当该值为0时, 仅指定的颜色可以透明显示;当该值为255时, 所有颜色都将透明显示。
|
LayerSettingType |
getType()
获取该图层的类型, 继承并重新实现
LayerSetting.getType()方法 |
java.lang.String[] |
getVisibleSubLayers()
获取当前可见图层的集合,返回字符串数组。
|
boolean |
isTransparent()
当前影像图层背景色是否透明显示
当其值为true时,
setTransparentColor(Color)指定的颜色透明。 |
void |
setCacheMaxSize(int nMaxSize)
设置图层的最大缓存数
|
void |
setDisplayBandIndexes(int[] bandIndexes)
设置当前影像图层显示的波段索引。
|
void |
setDisplayColorSpace(ColorSpaceType colorSpace)
设置影像图层的色彩显示模式。
|
void |
setDisplayMode(ImageDisplayMode displayMode)
设置影像显示模式
|
void |
setImageStretchOption(ImageStretchOption imageStretchOption)
设置图层多波段Image的拉伸方式
|
void |
setMapLayersID(java.lang.String layersID)
设置地图指定图层集合(针对Rest服务)。
|
void |
setTransparent(boolean transparentEnable)
设置影像图层背景色是否透明显示
|
void |
setTransparentColor(Color color)
设置影像图层中需要透明显示的背景色
除了设需要透明显示的颜色外,还需要通过
setTransparent(boolean)来允许透明显示该颜色 |
void |
setTransparentColorTolerance(int value)
设置透明背景色的容限
透明容限值范围为[0,255],当该值为0时, 仅指定的颜色可以透明显示;当该值为255时, 所有颜色都将透明显示。
|
void |
setVisibleSubLayers(java.lang.String[] subLayers)
设置当前可见图层的集合。
|
public LayerSettingImage()
public LayerSettingImage(LayerSettingImage layerSettingImage)
layerSettingImage - 指定的LayerSettingImage对象public LayerSettingType getType()
LayerSetting.getType()方法getType 在类中 LayerSettingLayerSettingType。
如果没有关联图层,返回null。public boolean isTransparent()
setTransparentColor(Color)指定的颜色透明。
默认不透明, 即返回false。public void setTransparent(boolean transparentEnable)
transparentEnable - boolean类型, 表示影像图层背景色是否透明。
当其值为true时,setTransparentColor(Color)指定的颜色透明。public Color getTransparentColor()
Color类型, 返回当指定的透明背景色。
如果是新创建的对象,则返回nullpublic void setTransparentColor(Color color)
除了设需要透明显示的颜色外,还需要通过setTransparent(boolean)来允许透明显示该颜色
color - Color类型, 需要透明显示的背景色public int getTransparentColorTolerance()
透明容限值范围为[0,255],当该值为0时, 仅指定的颜色可以透明显示;当该值为255时, 所有颜色都将透明显示。 默认值为0。
public void setTransparentColorTolerance(int value)
透明容限值范围为[0,255],当该值为0时, 仅指定的颜色可以透明显示;当该值为255时, 所有颜色都将透明显示。
当且仅当isTransparent()的值为true时, 该设置才有效。
value - int类型, 需要设置的透明背景色容限值。
如果value<0,则实际设置为0; 如果value>255,则实际设置为255;public java.lang.String[] getAllSubLayers()
public java.lang.String[] getVisibleSubLayers()
public void setVisibleSubLayers(java.lang.String[] subLayers)
subLayers - 图层名称集合。public void setMapLayersID(java.lang.String layersID)
layersID - 指定图层集合的ID.public java.lang.String getMapLayersID()
public int[] getDisplayBandIndexes()
public void setDisplayBandIndexes(int[] bandIndexes)
bandIndexes - 当前影像图层显示的波段索引public ImageDisplayMode getDisplayMode()
public void setDisplayMode(ImageDisplayMode displayMode)
displayMode - 影像显示模式,多波段支持两种显示模式,单波段只支持拉伸显示模式public ColorSpaceType getDisplayColorSpace()
public void setDisplayColorSpace(ColorSpaceType colorSpace)
colorSpace - 影像图层的色彩显示模式public ImageStretchOption getImageStretchOption()
public void setImageStretchOption(ImageStretchOption imageStretchOption)
imageStretchOption - 拉伸参数public void add(Datasource datasource, java.lang.String strSLDFilePath)
datasource - 数据所在的数据源strSLDFilePath - SLD文件路径public void setCacheMaxSize(int nMaxSize)
nMaxSize - 最大缓存数public int getCacheMaxSize()