首頁 > web前端 > js教程 > 使用openlayers4如何實現點的擴散?

使用openlayers4如何實現點的擴散?

亚连
發布: 2018-06-11 10:18:26
原創
1934 人瀏覽過

這篇文章主要為大家詳細介紹了基於openlayers4實現點的擴散效果,具有一定的參考價值,有興趣的小伙伴們可以參考一下

本文實例為大家分享了openlayers4實現點的擴散效果,供大家參考,具體內容如下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

<!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
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板