Class: Bubble

.Visuals.Custom. Bubble

气泡图层

new Bubble(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Description
id String 图层id
data Array 数据,geojson格式
visibility Boolean 图层默认是否显示
dragdrawing Boolean 拖动图层时是否绘制
rendererOptions Object 渲染配置
Properties
Name Type Description
markPoint Object 标注
Properties
Name Type Description
nameField String 属性名动态选取,可缺省,缺省使用name属性字段
valueField String 属性值动态选取,可缺省,缺省使用value属性字段
valueFilter Array 属性值过滤
filterColor Array 根据属性值过滤出的标注的颜色
filterSize Array 根据属性值过滤出的标注的大小
filterIncrement Array 根据属性值过滤出的标注的动画速度
threshold Array 属性值范围过滤
thresholdSize Array 根据属性值范围过滤出的标注的大小
thresholdColor Array 根据属性值范围过滤出的标注的颜色
thresholdIncrement Array 根据属性值范围过滤出的标注的动画速度
increment Number 标注的动画速度,范围[0,1],若设置该值,则markPoint.effect.period将不会生效
hoverable Boolean 是否启用鼠标悬浮
clickable Boolean 是否启用鼠标点击
symbol String 标注图形类型,可选为:'bubble' | 'circle' | 'ring' | 'pin' | 'rmb' | 'round' | 'fire' | 'water' | 'ellipse' | 'heatmap' | 'icon' | 'sprite' | 'simple'
symbolMinSize Number 标注最小大小
symbolMaxSize Number 标注最大大小
symbolNumber Number 最大绘制的标注数量
symbolValueRangeScale Number 标注统计值范围的缩放倍数,默认为1
symbolSrc Number 标注图标文件路径,适用于标注图形类型为icon
symbolWidth Number 标注图标宽度,适用于标注图形类型为icon
symbolHeight Number 标注图标高度,适用于标注图形类型为icon
effect Object 动画特效
Properties
Name Type Description
show Boolean 是否启用动画
period Number 运动周期,无单位,值越大越慢
scaleSize Number 缩放倍数,以标注大小为基准
ringNumber Number 圆环数量,默认为2,适用于标注图形类型为ring
circleNumber Number 圆圈数量,默认为3,适用于标注图形类型为circle
itemStyle Object 图形样式属性
Properties
Name Type Description
flat Boolean 扁平的,默认为true
color String 颜色
lineWidth Number 线宽
shadowColor String 阴影颜色
shadowBlur Number 阴影模糊度
shadowOffsetX Number 阴影偏移量X
shadowOffsetY Number 阴影偏移量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:
  • kz
Source:
View2D/Visuals/Custom/Bubble.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 bubble = new GeoGlobe.Visuals.Custom.Bubble({
    id: "bubble_1",
    data: [{"type": "Feature", "properties": {name: "湖北省", value: 666}, "geometry": {"type": "Point", "coordinates": [112.26577320468478, 30.98857642486671]}}],
    visibility: true,
    dragdrawing: true,
    rendererOptions: {
        markPoint: {
            symbol: 'bubble',
            symbolMinSize: 20,
            symbolMaxSize: 40,
            effect: {
                show: true,
                period: 10,
                scaleSize: 2
            },
            itemStyle: {
                color: 'rgba(255,0,0,0.7)'
            },
            label: {
                show: false
            }
        }
    }
 });
 //添加到可视化定制图层
 bubble.addTo(custom);
 //绘制
 custom.render();

Members


cacheCanvas :Array

离屏画布集合
Type:
  • Array
Source:
View2D/Visuals/Custom/Bubble.js

cacheCanvasContext :Array

离屏画布的上下文集合
Type:
  • Array
Source:
View2D/Visuals/Custom/Bubble.js

canvas :Array

画布集合,使用分层画布分别绘制
Type:
  • Array
Source:
View2D/Visuals/Custom/Bubble.js

canvasContext :Array

画布的上下文集合
Type:
  • Array
Source:
View2D/Visuals/Custom/Bubble.js

dragdrawing :Boolean

拖动图层时是否绘制
Type:
  • Boolean
Source:
View2D/Visuals/Custom/Bubble.js

MarkPoint :function

标注类
Type:
  • function
Source:
View2D/Visuals/Custom/Bubble.js

markPoints :Array

标注对象集
Type:
  • Array
Source:
View2D/Visuals/Custom/Bubble.js

visibility :Boolean

图层默认是否显示
Type:
  • Boolean
Source:
View2D/Visuals/Custom/Bubble.js

Methods


addTo(custom)

关联可视化定制图层对象
Parameters:
Name Type Description
custom GeoGlobe.Visuals.Custom
Source:
View2D/Visuals/Custom/Bubble.js

clearCanvas()

画布清空
Source:
View2D/Visuals/Custom/Bubble.js

destroy()

销毁图层
Source:
View2D/Visuals/Custom/Bubble.js

draw()

图层绘制
Source:
View2D/Visuals/Custom/Bubble.js

drawCanvas1()

将标注静态部分绘制到画布1
Source:
View2D/Visuals/Custom/Bubble.js

drawCanvas2()

将标注动画部分绘制到画布2
Source:
View2D/Visuals/Custom/Bubble.js

hideTooltip()

关闭悬浮提示
Source:
View2D/Visuals/Custom/Bubble.js

hideTooltip()

关闭悬浮提示
Source:
View2D/Visuals/Custom/Fluorescence.js

hover(x, y)

鼠标悬浮时触发
Parameters:
Name Type Description
x Number 鼠标在主画布上的位置(x轴方向)
y Number 鼠标在主画布上的位置(y轴方向)
Source:
View2D/Visuals/Custom/Bubble.js

hover(x, y)

鼠标悬浮时触发
Parameters:
Name Type Description
x Number 鼠标在主画布上的位置(x轴方向)
y Number 鼠标在主画布上的位置(y轴方向)
Source:
View2D/Visuals/Custom/Fluorescence.js

moveCanvas()

画布平移
Source:
View2D/Visuals/Custom/Bubble.js

onClick(event)

鼠标指针单击事件
Parameters:
Name Type Description
event Object 事件参数
Source:
View2D/Visuals/Custom/Bubble.js

onClick(event)

鼠标指针单击事件
Parameters:
Name Type Description
event Object 事件参数
Source:
View2D/Visuals/Custom/Fluorescence.js

onMouseMove(event)

鼠标指针悬停事件
Parameters:
Name Type Description
event Object 事件参数
Source:
View2D/Visuals/Custom/Bubble.js

onMouseMove(event)

鼠标指针悬停事件
Parameters:
Name Type Description
event Object 事件参数
Source:
View2D/Visuals/Custom/Fluorescence.js

onMove()

图层(地图)移动时触发: 1、若拖拽时绘制,暂停动画,更新屏幕坐标并重绘画布 2、若拖拽时不绘制,地图未倾斜时的平移,移动画布而不重绘 3、若拖拽时不绘制,其他情况下的地图移动,清空画布
Source:
View2D/Visuals/Custom/Bubble.js

onMoveEnd()

图层(地图)移动结束触发
Source:
View2D/Visuals/Custom/Bubble.js

onMoveEnd()

图层(地图)移动结束触发
Source:
View2D/Visuals/Custom/Fluorescence.js

onResize()

图层自适应
Source:
View2D/Visuals/Custom/Bubble.js

redraw()

图层重绘
Source:
View2D/Visuals/Custom/Bubble.js

render()

渲染图层
Source:
View2D/Visuals/Custom/Bubble.js

resetCanvas()

画布复位
Source:
View2D/Visuals/Custom/Bubble.js

setData(data)

数据的处理,构造标注对象
Parameters:
Name Type Description
data Array 数据
Source:
View2D/Visuals/Custom/Bubble.js

setVisible(visibility)

图层的显示与隐藏
Parameters:
Name Type Description
visibility Boolean 可见性
Source:
View2D/Visuals/Custom/Bubble.js

stopDraw()

停止绘制
Source:
View2D/Visuals/Custom/Bubble.js

updateXY()

重新计算标注的屏幕坐标
Source:
View2D/Visuals/Custom/Bubble.js