Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions examples/leaflet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<title>Open-Meteo Leaflet Layer - Temperature Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="../dist/index.js"></script>
<style>
html,
body,
#map {
margin: 0;
padding: 0;
height: 100%;
}
#map {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// Create the Leaflet map
const map = L.map('map').setView([50, 10], 4);

// Add OpenStreetMap base layer
L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; OpenStreetMap Contributors',
maxZoom: 19
}).addTo(map);

// s3 storage structure: /data_spatial/{domain}/{modelRun /year/month/day/time}Z/{selectedTime year-month-day-time.om}?variable={variable}
const omUrl = `https://map-tiles.open-meteo.com/data_spatial/dwd_icon/2025/10/15/1200Z/2025-10-15T1400.om?variable=temperature_2m`;
const omProtocolOptions = OpenMeteoMapboxLayer.defaultOmProtocolSettings;
// OpenMeteoMapboxLayer might not be a good name anymore
OpenMeteoMapboxLayer.initOMFile(omUrl, omProtocolOptions).then(() => {
const omLayer = new OpenMeteoMapboxLayer.OpenMeteoLeafletLayer({
omUrl: omUrl
});
map.addLayer(omLayer);
});
</script>
</body>
</html>
Loading