>  기사  >  웹 프론트엔드  >  openlayers4를 사용하여 점 확산을 달성하는 방법은 무엇입니까?

openlayers4를 사용하여 점 확산을 달성하는 방법은 무엇입니까?

亚连
亚连원래의
2018-06-11 10:18:261777검색

이 글은 주로 openlayers4를 기반으로 한 포인트의 확산 효과를 자세히 소개합니다. 관심 있는 친구들이 참고할 수 있습니다.

이 글의 예시는 모두를 위해 openlayers4가 구현하는 포인트의 확산 효과를 공유합니다. , 구체적인 내용은 다음과 같습니다

<!DOCTYPE html> 
<html lang="en"> 
<head> 
  <meta charset="UTF-8"> 
  <title>Title</title> 
  <link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" rel="external nofollow" type="text/css">  
  <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->  
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>  
  <script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script> 
  <style> 
    .css_animation{ 
      height:100px; 
      width:100px; 
      border-radius: 50%; 
      background: rgba(255, 0, 0, 0.9); 
      transform: scale(0); 
      animation: myfirst 3s; 
      animation-iteration-count: infinite; 
    } 
    @keyframes myfirst{ 
      to{ 
        transform: scale(2); 
        background: rgba(0, 0, 0, 0); 
      } 
    } 
 
  </style> 
</head> 
<body> 
  <p id="map" style="width: 100%;height: 100%"></p> 
  <script> 
    var map = new ol.Map({ 
      layers:[new ol.layer.Tile({ 
        source:new ol.source.OSM() 
      })], 
      target:&#39;map&#39;, 
      view:new ol.View({ 
        center: [12950000, 4860000], 
        zoom:7 
      }) 
    }); 
 
    var point_p = document.createElement(&#39;p&#39;); 
    point_p.className = &#39;css_animation&#39;; 
    point_overlay = new ol.Overlay({ 
      element:point_p, 
      positioning:&#39;center-center&#39; 
    }); 
    map.addOverlay(point_overlay); 
 
    point_overlay.setPosition([12950000, 4860000]); 
  </script> 
</body> 
</html>

위 내용은 앞으로 모든 분들께 도움이 되길 바랍니다.

관련 기사:

JS에서 단일 객체의 투명도를 변경하는 방법

JS에서 드래그하여 객체의 크기를 변경하는 방법

vue에서 cli를 사용하여 다중 재구성을 구현하는 방법 -페이지 비계

위 내용은 openlayers4를 사용하여 점 확산을 달성하는 방법은 무엇입니까?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.