openlayer打点模拟波纹扩散效果
方法定义
addAnimatePoint(point) {
// 定义一个打点图层,必须是矢量层
let that = this
let pointAnimationLayer = new VectorLayer({
source: new VectorSource()
})
// 可传类型为icon/circle
let pointType = point.pointType ? point.pointType : 'circle'
let imageStyle
if (pointType == 'icon') {
imageStyle = new Icon({
src: point.pointStyle.src,
color: point.pointStyle.iconColor || 'white'
})
} else {
imageStyle = new CircleStyle({
fill: new Fill({
color: point.pointStyle.circleColor || 'red'
}),
radius: point.pointStyle.circleRadius || 5
})
}
// 添加矢量层