-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapsTest.html
More file actions
42 lines (38 loc) · 1.3 KB
/
mapsTest.html
File metadata and controls
42 lines (38 loc) · 1.3 KB
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 lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meine Route</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<style>
#map {
height: calc(100vh - 50px);
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// Karte initialisieren
var map = L.map('map').setView([51.1657, 10.4515], 6); // Deutschland-Zentrum
// OpenStreetMap als Hintergrundkarte
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Test Karte von ChatGPT erstellt mit OpenSource Karte :)',
}).addTo(map);
// Deine Standorte als Koordinaten
var routeCoords = [
[48.137154, 11.576124], // München
[52.520008, 13.404954], // Berlin
[50.110924, 8.682127] // Frankfurt
];
// Linie zeichnen
var polyline = L.polyline(routeCoords, {color: 'green'}).addTo(map);
// Karte auf die Route zoomen
map.fitBounds(polyline.getBounds());
</script>
<p>Dies ist eine karte mit 3 linien!</p>
</body>
</html>