Skip to content

Instantly share code, notes, and snippets.

@tobwen
Created November 8, 2022 00:06
Show Gist options
  • Save tobwen/d0e363cce4bc2f7b25d38766ac42065f to your computer and use it in GitHub Desktop.
Save tobwen/d0e363cce4bc2f7b25d38766ac42065f to your computer and use it in GitHub Desktop.
basemap.de Web Vektor - MapLibre GL Leaflet Demo
<!DOCTYPE html>
<html>
<head>
<title>basemap.de Web Vektor - Leaflet Demo</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"></script>
<script src="https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.17/leaflet-maplibre-gl.js"></script>
<script>
var map = L.map('map', {
minZoom: 6,
maxZoom: 18,
});
var gl = L.maplibreGL({
style: 'https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/styles/bm_web_col.json',
}).addTo(map);
map.setView([51, 10], 6);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment