forked from ablakey/Leaflet.SimpleGraticule
-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.html
41 lines (37 loc) · 1.06 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">
<title>L.AutoGraticule Example</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
<link rel="stylesheet" href="https://esm.sh/leaflet/dist/leaflet.css" />
<style type="text/css">
html, body { width: 100%; height: 100%; margin: 0; }
#map { width: 100%; height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script type="importmap">
{
"imports": {
"leaflet": "https://esm.sh/leaflet",
"leaflet-auto-graticule": "./dist/L.AutoGraticule.js"
}
}
</script>
<script type="module">
import * as L from 'leaflet';
import AutoGraticule from 'leaflet-auto-graticule';
var map = L.map('map',{
center: [0,0],
zoom: 5,
});
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: '© <a href="http://www.openstreetmap.org/copyright" target="_blank">OSM Contributors</a>',
noWrap: true
}).addTo(map);
new AutoGraticule().addTo(map);
</script>
</body>
</html>