Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Description |
id |
String
|
图层id |
data |
Array
|
数据,geojson格式 |
visibility |
Boolean
|
图层默认是否显示 |
legend |
Object
|
图例配置
Properties
Name |
Type |
Description |
show |
Boolean
|
是否显示图例 |
title |
String
|
图例标题 |
left |
Number
|
距左边界的距离 |
right |
Number
|
距右边界的距离 |
top |
Number
|
距上边界的距离 |
bottom |
Number
|
距下边界的距离 |
col |
Number
|
图例项的列数 |
itemSize |
Number
|
图例项图形大小 |
itemColors |
Array
|
图例项图形颜色集 |
itemStatuses |
Array
|
图例项启用状态,0表示未启用、1表示启用 |
backgroundColor |
String
|
背景颜色 |
borderColor |
String
|
边框颜色 |
borderWidth |
Number
|
边框线宽 |
borderRadius |
Number
|
边框圆角 |
shadowColor |
String
|
阴影颜色 |
shadowBlur |
Number
|
阴影模糊度 |
shadowOffsetX |
Number
|
阴影水平偏移量 |
shadowOffsetY |
Number
|
阴影垂直偏移量 |
padding |
Number
|
内边距 |
textStyle |
String
|
文字样式
Properties
Name |
Type |
Description |
color |
String
|
颜色 |
fontFamily |
String
|
字体系列 |
fontSize |
Number
|
字号 ,单位px |
fontStyle |
String
|
样式,可选为:'normal' | 'italic' | 'oblique' |
fontWeight |
String
|
Number
|
粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900 |
|
|
rendererOptions |
Object
|
渲染配置
Properties
Name |
Type |
Description |
markPoint |
Object
|
标注
Properties
Name |
Type |
Description |
unactivatedDrawable |
Boolean
|
是否绘制未激活状态的标注,为true时以灰色调进行绘制 |
symbol |
String
|
标注图形类型,可选为:'square' | 'round' | 'square2' |
symbolSize |
Number
|
标注大小 |
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
color |
String
|
颜色 |
shadowColor |
String
|
阴影颜色 |
shadowBlur |
Number
|
阴影模糊度 |
shadowOffsetX |
Number
|
阴影偏移量X |
shadowOffsetY |
Number
|
阴影偏移量Y |
|
|
|
|
- Author:
-
- Source:
-
View2D/Visuals/Custom/Scatter.js
Example
//构造地图对象
var map = new GeoGlobe.Map({
style: Cfg.style,
container: 'map',
zoom: 16,
bearing: 0,
pitch: 0,
units: "degrees",
center: [114.20509630753577, 30.776055193053764]
});
//构造可视化定制图层
var custom = new GeoGlobe.Visuals.Custom();
//添加到地图中
custom.addTo(map);
//通过jquery加载json数据
$.getJSON('../../data/xuzhou.json', function (result) {
//构造地域分布(散点)图层
var scatter = new GeoGlobe.Visuals.Custom.Scatter({
id: "scatter_1",
data: result.features,
visibility: true,
legend:{
show: true,
left: 10,
top: 10,
col: 1,
itemSize: 10,
itemColors: ["#4f19c7","#c71969","#1984c7","#8419c7","#c76919","#c78419","#199fc7","#9f19c7",
"#69c719","#b9c719","#3419c7","#19b9c7","#19c74f","#c79f19","#19c7b9","#34c719",
"#FFD7AA","#8DD7FF","#FFD766"],
itemStatuses: [1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0],
padding: 5
},
rendererOptions: {
markPoint: {
unactivatedDrawable: false,
symbol: 'square',
symbolSize: 1
}
}
});
//添加到可视化定制图层
scatter.addTo(custom);
//绘制
custom.render();
});