Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Description |
id |
String
|
图层id |
data |
Array
|
数据,geojson格式 |
visibility |
Boolean
|
图层默认是否显示 |
boundsURL |
String
|
边界数据url |
rendererOptions |
Object
|
渲染配置
Properties
Name |
Type |
Description |
markFace |
Object
|
标面
Properties
Name |
Type |
Description |
hoverable |
Boolean
|
是否启用鼠标悬浮 |
clickable |
Boolean
|
是否启用鼠标点击 |
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
color |
String
|
颜色,支持单色和渐变色 |
borderColor |
String
|
边框颜色 |
borderWidth |
Number
|
边框宽度 |
shadowColor |
String
|
阴影颜色 |
shadowBlur |
Number
|
阴影模糊度 |
shadowOffsetX |
Number
|
阴影偏移量X |
shadowOffsetY |
Number
|
阴影偏移量Y |
|
|
tooltip |
Object
|
悬浮提示
Properties
Name |
Type |
Description |
show |
Boolean
|
是否显示悬浮提示框 |
backgroundColor |
String
|
背景颜色 |
borderColor |
String
|
边框颜色 |
borderRadius |
Number
|
边框圆角 |
borderWidth |
Number
|
边框宽度 |
padding |
Number
|
内边距 |
textStyle |
Object
|
文字样式
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 |
|
|
|
|
- Source:
-
View2D/Visuals/Custom/Delaunay.js
Example
//构造地图对象
var map = new GeoGlobe.Map({
style: Cfg.style,
container: "map",
zoom: 16,
bearing: 0,
pitch: 0,
units: "degree",
center: [114.20509630753577, 30.776055193053764]
});
//构造可视化定制图层
var custom = new GeoGlobe.Visuals.Custom();
//添加到地图中
custom.addTo(map);
//通过jquery加载json数据
$.getJSON("../../data/capital.json", function (result) {
//构造Delaunay三角网图层
var delaunay = new GeoGlobe.Visuals.Custom.Delaunay({
id: "delaunay_1",
data: result,
visibility: true,
boundsURL: "../../data/china.json",
rendererOptions: {
markFace: {
itemStyle: {
color: {
'0': 'rgba(255, 0, 0, 0.3)',
'0.5': 'rgba(255, 128, 0, 0.3)',
'1': 'rgba(255, 255, 128, 0.3)'
},//'rgba(255,0,0,0)',
borderColor: 'rgba(255,255,255,0.5)'
}
}
}
});
//添加到可视化定制图层
delaunay.addTo(custom);
//绘制
custom.render();
});