-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
88 lines (72 loc) · 2.25 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
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Leaflet.StarCircle</title>
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" rel="stylesheet"/>
<script src="src/leaflet-starcircle.js"></script>
<style>
html, body{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#map{
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map',{
//renderer: L.canvas()
}).setView([47.506997, 9.759292], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
// renderer: L.canvas(), // support both SVG & Canvas
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var mapCenter = map.getCenter();
var star1 = L.starCircleMarker(mapCenter,{
radius: 30,
star: 3,
}).addTo(map);
var star2 = L.starCircle(L.latLng(mapCenter.lat - 0.04, mapCenter.lng - 0.04), {
radius: 300,
star: 4,
}).addTo(map);
var star3 = L.starCircleMarker(L.latLng(mapCenter.lat - 0.04, mapCenter.lng), {
radius: 40,
star: 5,
}).addTo(map);
var star4 = L.starCircle(L.latLng(mapCenter.lat - 0.04, mapCenter.lng + 0.04), {
radius: 400,
star: 6,
}).addTo(map);
var star5 = L.starCircleMarker(L.latLng(mapCenter.lat, mapCenter.lng + 0.04), {
radius: 50,
star: 7,
}).addTo(map);
var star6 = L.starCircle(L.latLng(mapCenter.lat + 0.04, mapCenter.lng + 0.04), {
radius: 500,
star: 8,
}).addTo(map);
var star7 = L.starCircleMarker(L.latLng(mapCenter.lat + 0.04, mapCenter.lng), {
radius: 60,
star: 9,
}).addTo(map);
var star8 = L.starCircle(L.latLng(mapCenter.lat + 0.04, mapCenter.lng - 0.04), {
radius: 600,
star: 10,
}).addTo(map);
var star9 = L.starCircleMarker(L.latLng(mapCenter.lat, mapCenter.lng - 0.04), {
radius: 60,
star: 11,
}).addTo(map);
</script>
</body>
</html>