-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
42 lines (29 loc) · 1.86 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
<!DOCTYPE html>
<html>
<head>
<title>Mobile tutorial - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js" integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log==" crossorigin=""></script>
<script src="L.mytrack.js"></script> <!-- plugin -->
</head>
<body>
<div id='map' style="width: 98vw; height: 100vh;"></div> <!-- height: 100%; width: 90vw; -->
<!-- <a download='mytrack.json' onclick='this.href="data:application/geo+json,"+JSON.stringify(gpx)'>⬇</a> -->
<script>
var karte = L.map('map',{center: [48.37, 10.89],zoom: 12}) //.fitWorld();
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(karte);
karte.locate({watch: true, enableHighAccuracy: true}); //setView: true, , maxZoom: 16
L.control.watermark({ position: 'bottomright' }).addTo(karte); //download-button
var mytrack=L.mytrack({click:location.search?true:false}).addTo(karte) //{click:false} //querstringparameter ?1 draw track //must be named mytrack!
</script>
</body>
</html>