new SimpleRenderer(options)
document/renderer/SimpleRenderer.js, line 7
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
构造参数
|
Examples
// ES5引入方式
const { SimpleRenderer } = zondy.renderer
const { SimpleMarkerSymbol, SimpleLineSymbol } = zondy.symbol
const { Color } = zondy
// ES6引入方式
import { SimpleRenderer, SimpleMarkerSymbol, SimpleLineSymbol, Color } from "@mapgis/webclient-common"
// 初始化统一专题图样式对象
const simpleRenderer = new SimpleRenderer({
// 样式对象,更多样式详见:《SimpleMarkerSymbol》
symbol: new SimpleMarkerSymbol({
// 填充颜色
color: 'rgba(1,1,252,0)',
// 点半径
size: 13,
// 外边线样式
outline: new SimpleLineSymbol({
//线颜色
color: new Color(255, 1, 0, 1),
//线宽
width: 1
})
})
});
// ES5引入方式
const { SimpleRenderer } = zondy.renderer
const { SimpleLineSymbol } = zondy.symbol
const { Color } = zondy
// ES6引入方式
import { SimpleRenderer, SimpleLineSymbol, Color } from "@mapgis/webclient-common"
// 初始化统一专题图样式对象
const simpleRenderer = new SimpleRenderer({
// 样式对象,更多样式详见:《SimpleLineSymbol》
symbol: new SimpleLineSymbol({
//线符号颜色
color: new Color(255, 1, 0, 11),
//线宽
width: 1
})
});
// ES5引入方式
const { SimpleRenderer } = zondy.renderer
const { SimpleFillSymbol, SimpleLineSymbol } = zondy.symbol
const { Color } = zondy
// ES6引入方式
import { SimpleRenderer, SimpleFillSymbol, SimpleLineSymbol, Color } from "@mapgis/webclient-common"
// 初始化统一专题图样式对象,更多样式详见:《SimpleFillSymbol》
const simpleRenderer = new SimpleRenderer({
// 样式对象,更多样式详见:《SimpleLineSymbol》
symbol: new SimpleFillSymbol({
// 填充颜色
color: 'rgba(1,1,252,0)',
// 外边线样式
outline: new SimpleLineSymbol({
//线颜色
color: new Color(255, 1, 0, 1),
//线宽
width: 1
})
})
});
Extends
Members
-
descriptionString
-
渲染器的描述信息
-
idString
-
渲染器id
-
labelString
-
渲染器标签,描述渲染器含义
-
symbolSymbol
-
defaultSymbol 统一专题图样式
-
typeString
-
type 'simple',统一专题图
-
visualVariablesArray.<VisualVariable>
-
视觉变量
Methods
-
SimpleRenderer.fromJSON(json){SimpleRenderer}
document/renderer/SimpleRenderer.js, line 165 -
通过json构造SimpleRenderer对象
Name Type Description jsonObject Returns:
Type Description SimpleRenderer 新创建的SimpleRenderer对象 Example
通过json创造SimpleRenderer对象 let simpleRenderer = SimpleRenderer.fromJSON({ // 初始化参数 }) -
clone(){SimpleRenderer}
document/renderer/SimpleRenderer.js, line 151 -
克隆renderer对象
Returns:
Type Description SimpleRenderer 克隆后的renderer对象 -
inherited fromJSON(json)
document/renderer/BaseRenderer.js, line 50 -
将JSON格式的渲染规则转换为JS对象
Name Type Description jsonObject 渲染规则的实例化JSON
-
toJSON(){Object}
document/renderer/SimpleRenderer.js, line 136 -
导出为json对象
Returns:
Type Description Object json对象