在vue里创建div,给一个class,渲染到openlayers地图上,css里给class添加动画不生效
var point_div = document.createElement("div");
point_div.className = "anchorImg";
point_overlay = new ol.Overlay({
element: point_div,
positioning: "bottom-center"
});
map.addOverlay(point_overlay);
point_overlay.setPosition(coor);
})
css动画
.anchorImg {
height: 50px;
width: 50px;
border-radius: 25px;
background: rgba(255, 0, 0, 1);
transform: scale(0);
animation: myfirst 2s;
animation-iteration-count: infinite;
}
@keyframes myfirst {
to {
transform: scale(2);
background: rgba(0, 0, 0, 0);
}
}