-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet-circle-cdn.html
48 lines (33 loc) · 1.11 KB
/
leaflet-circle-cdn.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
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script>
<style type="text/css">
#map { height: 100%; }
</style>
</head>
<body>
<div id="map"/>
<script>
var mymap = L.map('map').setView([52.44972, 9.89431], 18);
var ic = L.icon({
iconUrl: 'circle.png',
iconSize: [64,64],
iconAnchor: [32,32],
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
var cir = L.marker([52.44972, 9.89431], {icon: ic}).addTo(mymap);
//L.marker([51.5, -0.09]).addTo(mymap);
function onMapClick(e) {
cir.setLatLng(e.latlng)
}
mymap.on('click', onMapClick);
</script>
</body>
</html>