forked from bbecquet/Leaflet.RotatedMarker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
45 lines (40 loc) · 1.47 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Leaflet rotated marker example</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<style>
* { margin: 0; padding: 0; }
html, body { height: 100%; }
#map { width:100%; height:100%; }
</style>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<script src="leaflet.rotatedMarker.js"></script>
<script>
window.onload = function() {
var map = L.map('map', {
center: [48.8631169, 2.3708919],
zoom: 8,
layers: [
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
})
]
});
var m = L.marker(map.getCenter(), {
rotationAngle: 45,
draggable: true
}).addTo(map);
};
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>