-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
79 lines (71 loc) · 2.63 KB
/
index.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
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>magicMarker</title>
<link href="./lib/magic.min.css" rel="stylesheet">
<link href="./lib/leaflet.css" rel="stylesheet">
<link href="./css/magicMarker.css" rel="stylesheet">
<style>
html,body,#map{
position: absolute;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="./lib/leaflet.js"></script>
<script src="./dist/leaflet.magicMarker.js"></script>
<script>
var map = L.map('map').setView([51.505, -0.09], 12);
L.tileLayer('https://api.mapbox.com/styles/v1/jeffmerrick/cihz2gbd400siaikoi4mfn3qb/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiamVmZm1lcnJpY2siLCJhIjoiVUVsV3E3ayJ9.cLqSLNQ6IdNDBhzAHVAOAQ').addTo(map);
L.marker.magic([51.55, -0.09], {
iconUrl: './img/magicIcon.png',
magic: 'vanishIn',
popupAnchor: [-6, -8]
})
.addTo(map)
.bindPopup('MagicMarker');
var magicArr = [
"twisterInDown", "twisterInUp", "swap",
"puffIn", "vanishIn",
"openDownLeftReturn", "openDownRightReturn", "openUpLeftReturn", "openUpRightReturn",
"perspectiveDownReturn", "perspectiveUpReturn", "perspectiveLeftReturn", "perspectiveRightReturn",
"slideDownReturn", "slideUpReturn", "slideLeftReturn", "slideRightReturn",
"swashIn", "foolishIn",
"tinRightIn", "tinLeftIn", "tinUpIn", "tinDownIn",
"boingInUp",
"spaceInUp", "spaceInRight", "spaceInDown", "spaceInLeft"];
var i = 0;
var showMagicMarker = setInterval(function () {
if (i < 28) {
var magicType = magicArr[i];
if (i < 14) {
L.marker.magic([51.58, -0.35 + i * 0.04], {
iconUrl: './img/magicIcon2.png',
magic: magicType,
popupAnchor: [-6, -8]
})
.addTo(map)
.bindTooltip(magicType);
} else {
L.marker.magic([51.53, -0.35 + (i - 14) * 0.04], {
iconUrl: './img/magicIcon2.png',
magic: magicType,
popupAnchor: [-6, -8]
})
.addTo(map)
.bindTooltip(magicType);
}
i++;
} else {
clearInterval(showMagicMarker);
}
}, 1000)
</script>
</body>
</html>