zoukankan      html  css  js  c++  java
  • openlayers通过overlay html5 css3设置图标闪烁效果

    openlayers通过overlay html5 css3设置图标闪烁效果

    页面中添加div,最好在map容器中

    <div id="css_animation"></div>

    css文件中添加样式,一定要卸载css文件中,否则会报错

    #css_animation {
        height: 30px;//图标高
        width: 30px;//图标高
        border-radius: 25px;//圆形
        background: rgb(255, 0, 0);//颜色 可以为rgba()透明度
        transform: scale(0.2);//变换初始大小
        animation: myfirst 2s;//变换速度
        animation-iteration-count:infinite;//重复闪烁
        z-index: 200;
    }
    
    @keyframes myfirst {
        to {
            transform: scale(0.8);//变换结束大小
            background: rgba(255, 0, 0,0);//结束时颜色
        }
    }

    map中添加overlay

     var point_div = document.getElementById("css_animation");
     var point_overlay = new ol.Overlay({//定义为全局变量
                element: point_div,
                positioning: 'center-center'
            });
     map.addOverlay(point_overlay);

    设置闪烁位置

    point_overlay.setPosition([12904227.7304252871, 5035631.757232161]);

    取消闪烁

    point_overlay.setPosition(undefined);
    GIS开发https://www.giserdqy.comGIS,WebGIS,ArcGIS,OpenLayers,Leaflet,Geoserver,PostGIS,BIM,空间大数据,GeoAI技术分享
  • 相关阅读:
    之前总结的,现在要找工作了,给大家分享一下
    numpy总结
    django知识分支_1
    Django小总结
    ORM
    百度在线编辑器 配置修改
    百度在线编辑器
    TP5 路由使用
    cache 订单队列
    绘制静态地图API-高德地图
  • 原文地址:https://www.cnblogs.com/dqygiser/p/9215836.html
Copyright © 2011-2022 走看看