Parameters:
Name |
Type |
Description |
options |
Object
|
Properties
Name |
Type |
Description |
id |
String
|
图层id |
data |
Array
|
数据,geojson格式 |
visibility |
Boolean
|
图层默认是否显示 |
direction |
String
|
迁徙方向,可选为:in | out |
location |
Object
|
起始位置or终点位置 |
rendererOptions |
Object
|
渲染配置
Properties
Name |
Type |
Description |
markLine |
Object
|
标线
Properties
Name |
Type |
Description |
hoverable |
Boolean
|
是否启用鼠标悬浮 |
curveness |
Number
|
曲线弯曲弧度,smooth为true时有效 |
effect |
Object
|
炫光特效
Properties
Name |
Type |
Description |
color |
String
|
炫光颜色 |
scaleSize |
Number
|
放大倍数,以标线宽度为基准 |
period |
Number
|
运动周期,无单位,值越大越慢 |
|
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
width |
Number
|
线宽 |
dash |
Array
|
用来绘制虚线,线段和间距长度数组,默认[] |
|
|
markPoint |
Object
|
标注
Properties
Name |
Type |
Description |
nameField |
String
|
属性名动态选取,可缺省,缺省使用name属性字段 |
valueField |
String
|
属性值动态选取,可缺省,缺省使用value属性字段 |
hoverable |
Boolean
|
是否启用鼠标悬浮 |
symbol |
String
|
标注图形类型,可选为:'circle' | 'ring' | 'emptyCircle' |
symbolMinSize |
Number
|
标注最小大小 |
symbolMaxSize |
Number
|
标注最大大小 |
effect |
Object
|
炫光特效
Properties
Name |
Type |
Description |
scaleSize |
Number
|
放大倍数,以标注大小为基准 |
period |
Number
|
运动周期,无单位,值越大越慢 |
|
gradientColor |
Object
|
标注颜色取值范围,并指定全局不透明度 |
itemStyle |
Object
|
图形样式属性
Properties
Name |
Type |
Description |
color |
String
|
颜色 |
shadowColor |
String
|
阴影颜色 |
shadowBlur |
String
|
阴影模糊度 |
shadowOffsetX |
String
|
阴影偏移量X |
shadowOffsetY |
String
|
阴影偏移量Y |
|
label |
Object
|
标签
Properties
Name |
Type |
Description |
show |
Boolean
|
标签是否显示 |
color |
String
|
颜色 |
align |
String
|
水平对齐方式,可选为:'start' | 'end' | 'left' | 'right' | 'center' |
baseline |
String
|
垂直对齐方式,可选为:'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom' |
fontFamily |
String
|
字体系列 |
fontSize |
Number
|
字号 ,单位px |
fontStyle |
String
|
样式,可选为:'normal' | 'italic' | 'oblique' |
fontWeight |
String/Number
|
粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900 |
|
|
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/Migration.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);
//构造迁徙图层
var migration = new GeoGlobe.Visuals.Custom.Migration({
id: "migration_1",
data: [{
"type": "Feature",
"properties": {name: "湖北省", value: 666},
"geometry": {
"type": "Point",
"coordinates": [112.26577320468478, 30.98857642486671]
}
},{
"type": "Feature",
"properties": {name: "山东省", value: 299},
"geometry": {
"type": "Point",
"coordinates": [118.15725615843111,36.354896713378366]
}
}],
visibility: true,
direction: "out",
location: {
name: "香港特别行政区",
lonLat: [114.12694391453464, 22.380716926328258]
},
rendererOptions: {
markLine: {
hoverable: true,
curveness: 0.6,
effect: {
color: '#fff',
scaleSize: 3,
period: 25
},
itemStyle: {
width: 1,
dash: [5, 5]
}
},
markPoint: {
symbol: "ring",
symbolMinSize: 20,
symbolMaxSize: 40,
effect: {
scaleSize: 3,
period: 20
},
itemStyle: {
color: {
"0": "rgba(58, 200, 0, 0.5)",
"0.5": "rgba(243, 255, 0, 0.5)",
"1": "rgba(255, 20, 0, 0.5)"
}//"rgba(255,0,0,0.5)"
},
label: {
show: false
}
}
}
});
//添加到可视化定制图层
migration.addTo(custom);
//绘制
custom.render();