forked from QingyaFan/data-visualization
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpoint-animation-overlay.html
72 lines (66 loc) · 1.74 KB
/
point-animation-overlay.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://openlayers.org/en/v4.0.1/css/ol.css" type="text/css">
<link rel="stylesheet" href="css/main.css" type="text/css">
<style>
#css_animation{
height:50px;
width:50px;
border-radius: 25px;
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>
<div id="css_animation"></div>
<div id="map"></div>
<script type="text/javascript" src="scripts/libs/jquery.js"></script>
<script type="text/javascript" src="scripts/libs/ol.js"></script>
<script type="text/javascript">
var tian_di_tu_road_layer = new ol.layer.Tile({
title: "天地图路网",
source: new ol.source.XYZ({
url: "http://t4.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}"
})
});
var tian_di_tu_annotation = new ol.layer.Tile({
title: "天地图文字标注",
source: new ol.source.XYZ({
url: 'http://t3.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}'
})
});
var map = new ol.Map({
target: 'map',
layers: [
tian_di_tu_road_layer,
tian_di_tu_annotation
],
controls: ol.control.defaults({}).extend([
new ol.control.MousePosition({})
]),
view: new ol.View({
center: [11468382.41282299,3502038.887913635],
zoom: 11
})
});
var point_div = document.getElementById("css_animation");
var point_overlay = new ol.Overlay({
element: point_div,
positioning: 'bottom-left',
stopEvent: false
});
map.addOverlay(point_overlay);
point_overlay.setPosition([11468382.41282299,3502038.887913635]);
</script>
</body>
</html>