55 lines
1.3 KiB
HTML
Executable File
55 lines
1.3 KiB
HTML
Executable File
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Solar Map</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
|
|
<style>
|
|
html, body, #map {
|
|
margin: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
|
|
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
|
|
<script>
|
|
const germanyBounds = [
|
|
[47, 5],
|
|
[55, 16]
|
|
];
|
|
|
|
const map = L.map('map', {
|
|
zoomControl: false
|
|
});
|
|
|
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
attribution: '© OpenStreetMap contributors'
|
|
}).addTo(map);
|
|
|
|
fetch('../data/solaranlagen.geojson')
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
L.geoJSON(data, {
|
|
pointToLayer: function (feature, latlng) {
|
|
return L.circleMarker(latlng, {
|
|
radius: 1,
|
|
color: '#004682',
|
|
weight: 1,
|
|
opacity: 1,
|
|
fillOpacity: 1
|
|
});
|
|
}
|
|
}).addTo(map);
|
|
|
|
map.fitBounds(germanyBounds, { padding: [20, 20] });
|
|
})
|
|
.catch(err => console.error("Failed to load GeoJSON:", err));
|
|
</script>
|
|
</body>
|
|
</html>
|