Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Description |
id |
String
|
图层id |
data |
Array
|
数据,geojson格式 |
visibility |
Boolean
|
图层默认是否显示 |
rendererOptions |
Object
|
渲染配置
Properties
Name |
Type |
Description |
markLine |
Object
|
标线
Properties
Name |
Type |
Description |
effect |
Object
|
散点特效
Properties
Name |
Type |
Description |
color |
String
|
散点颜色 |
scaleSize |
Number
|
缩放倍数,以标线宽度为基准 |
period |
Number
|
运动周期,无单位,值越大越慢 |
|
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
color |
String
|
颜色 |
width |
Number
|
线宽 |
|
|
markPoint |
Object
|
标注
Properties
Name |
Type |
Description |
hoverable |
Boolean
|
是否启用鼠标悬浮 |
symbolSize |
Number
|
标注大小 |
effect |
Object
|
炫光特效
Properties
Name |
Type |
Description |
scaleSize |
Number
|
缩放倍数,以标注大小为基准 |
period |
Number
|
运动周期,无单位,值越大越慢 |
|
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
color |
String
|
颜色 |
|
|
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 |
|
|
|
|
- Author:
-
- Source:
-
View2D/Visuals/Custom/Commute.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/jinling.json', function (result) {
//构造通勤图层
var commute = new GeoGlobe.Visuals.Custom.Commute({
id: "commute_1",
data: result,
visibility: true,
rendererOptions: {
markLine: {
effect: {
color: 'rgba(255,255,255,0.7)',
scaleSize: 60,
period: 15
},
itemStyle: {
color: 'rgba(255,58,53,0.9)',
width: 0.1
}
},
markPoint: {
symbolSize: 30,
effect: {
scaleSize: 2,
period: 15
},
itemStyle: {
color: 'rgba(255,255,255,0.7)'
}
}
}
});
//添加到可视化定制图层
commute.addTo(custom);
//绘制
custom.render();
});