-
Notifications
You must be signed in to change notification settings - Fork 102
/
example.html
41 lines (36 loc) · 1.29 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
<!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://cdn.leafletjs.com/leaflet/v1.1.0/leaflet.css" />
<style>
* { margin: 0; padding: 0; }
html, body { height: 100%; }
#map { width:100%; height:100%; }
</style>
<script src="https://cdn.leafletjs.com/leaflet/v1.1.0/leaflet-src.js"></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>