业务咨询
开发咨询
微信沟通

Class: TileLayerStyle

CMAP~ TileLayerStyle

瓦片样式类


new TileLayerStyle(tilelayer, param)

构造函数

Parameters:
Name Type Description
tilelayer CMAP.TileLayer

要应用样式的瓦片图层

param Object

参数列表

Properties
Name Type Description
template String

样式名称 支持CMAP.TileLayerStyle.DARKBLUE,CMAP.TileLayerStyle.DARKGREEN,CMAP.TileLayerStyle.NORMAL,CMAP.TileLayerStyle.CUSTOMCOLOR

customColor Array.<Number>

当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,代表瓦片图上的一层颜色滤镜,格式为[r,g,b]

brightness number

瓦片图亮度设置默认1.0

contrast number

瓦片对比度默认1.0

hue number

瓦片色调默认0.0

saturation number

瓦片饱和度默认1.0

grayFilterColorBar Array

瓦片图层灰度滤镜色带颜色,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,格式为 [[r,g,b], [r,g,b]]

grayFilterEnable boolean

是否允许灰度滤镜,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效

grayFilterPerBar Array

瓦片图层灰度滤镜 开关,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,格式为 [0.0, 1.0]

gamma number

瓦片伽马值默认1.0

Members


brightness :Number

瓦片亮度,默认值是1.0

Type:
  • Number
Example
tileLayer.style.brightness = 0.5;//瓦片亮度调为0.5

contrast :number

contrast 对比度,默认为1

Type:
  • number
Example
tileLayer.style.contrast = 0.5;//瓦片对比度调为0.5

customColor :Array

瓦片图层滤镜颜色,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,格式为[r,g,b]

Type:
  • Array
Example
tileLayer.style.template = CMAP.TileLayerStyle.CUSTOMCOLOR;//瓦片样式调为自定义
tileLayer.style.customColor = 'rgb(255,0,0)';//瓦片添加红色滤镜

gamma :number

瓦片gamma值

Type:
  • number
Default Value:
  • 1.0
Example
tileLayer.style.gamma = 0.5;//瓦片伽马值设置为0.5

grayFilterColorBar :Array

瓦片图层灰度滤镜色带颜色,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,格式为 [[r,g,b], [r,g,b]]

Type:
  • Array
Example
tileLayer.style.grayFilterColorBar = [[255.0, 0.0, 0.0], [0.0, 255.0, 0.0], [0.0, 0.0, 255.0]];// 颜色渐变值

grayFilterEnable :Boolean

瓦片图层灰度滤镜 开关,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效

Type:
  • Boolean

grayFilterPerBar :Array

瓦片图层灰度滤镜 灰度极值,仅当tileStyle==CMAP.TileLayerStyle.CUSTOMCOLOR时生效,格式为 [0.0, 1.0]

Type:
  • Array
Example
tileLayer.style.grayFilterPerBar = [0,0.5,1];

hue :number

瓦片色调

Type:
  • number
Default Value:
  • 0
Example
tileLayer.style.hue = 0.5;//瓦片色调设置为0.5

saturation :number

瓦片饱和度,默认为1

Type:
  • number
Example
tileLayer.style.saturation = 0.5;//瓦片饱和度设置为0.5

template :String

瓦片样式模板,目前支持CMAP.TileLayerStyle.DARKBLUE,CMAP.TileLayerStyle.DARKGREEN,CMAP.TileLayerStyle.NORMAL,CMAP.TileLayerStyle.CUSTOMCOLOR

Type:
  • String
Example
tileLayer.style.template = CMAP.TileLayerStyle.DARKBLUE;//瓦片样式调为深蓝