YY. ConnectorLine
覆盖物连接线,用来连接两个覆盖物,类似桥梁 基于 YY. Overlay
creation
- constructor(src, dest, [style], [pro], [conf])
- src {YY. Overlay} 起始覆盖物
- dest {YY. Overlay} 结束的覆盖物
- style {YY. Style} 样式
- pro {Object} 附加属性值
- conf {Object} 基本配置
events
- 参考 YY. Overlay
example
js
var point1 = new YY.Point(
lnglats[0],
YY.Style.formatImage({
markerFile: "./../assets/icons/0002.png"
}), {}, {
draggable: true
}
);
var point2 = new YY.Point(
lnglats[1],
YY.Style.formatImage({
markerFile: "./../assets/icons/0002.png"
}), {}, {
draggable: true
}
);
var conLine = new YY.ConnectorLine(
point1,
point2,
YY.Style.formatLine({
lineColor: "red"
})
);
vectorLayer.addOverlays([point1, point2, conLine]);
method
getSrcOverlay()
- 获取开始的覆盖物连接点
- 返回值: YY. Overlay
getDestOverlay()
- 获取结束的覆盖物连接点
- 返回值: YY. Overlay
animateShow(options,step)
- 动态显示线
- 参数
- {Object}
options
: 动画配置 - {function}
step
: 回调函数
- {Object}
- 返回值:
this