openlayers 显示闪烁的图标点

  

思路:需要在html代码生成N个要闪烁的点通过遍历生成html代码 ,然后再通过坐标定位点到相应的位置

$("#map").append("<div id='css_animation" + i + "' ><span class='pulse-icon1' style='background-color: #d0639c;z-index:9999999'><span class='item' style='box-shadow: 0 0 5px 2px #2f8'></span></span><div>");

 

                    var point_div = document.getElementById("css_animation" + i);

                    var point_overlay = new ol.Overlay({

                        element: point_div,

                        positioning: 'center-center'

                    });

                    map.addOverlay(point_overlay);

                    point_overlay.setPosition(p);

 

样式文件

.pulse-icon1 {

  1. display: inline-block;
  2. width: 15px;
  3. height: 15px;
  4. border-radius: 100%;
  5. background-color: red;
  6. z-index: 999999;
  7. position: relative;
  8. box-shadow: 1px 1px 8px 0 rgba(0, 0, 0, 0.75);

}

.item {

  1. box-shadow: 0 0 6px 2px #2f8;
  2. animation: pulsate 1s ease-out;
  3. animation-iteration-count: infinite;
  4. animation-delay: 1.1s;
  5. -webkit-border-radius: 100%;
  6. border-radius: 100%;
  7. height: 300%;
  8. width: 300%;
  9. animation: pulsate 2s infinite;
  10. position: absolute;
  11. margin: -100% 0 0 -100%;

}

 

效果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值