<html>
<head>
<meta charset="UTF-8" />
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" />
<style>
body { width: 100%; height: 100%; padding: 0; margin: 0; font-family: Arial, sans-serif; }
#map { width: 100%; height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<script>
// Initialize MapLibreGL map
let map = new maplibregl.Map({
container: "map",
style: "https://static.maptoolkit.net/rapidapi/styles/terrain.json?rapidapi-key=your-api-key",
center: [11.40037, 47.26816],
pitch: 65,
zoom: 12,
});
// Define terrain rgb tile source and add it to the map
map.on("load", () => {
map.addSource("terrain", {
type: "raster-dem",
tiles: ["https://maptoolkit.p.rapidapi.com/tiles/{z}/{x}/{y}/terrain.webp?rapidapi-key=your-api-key"],
tileSize: 256,
maxzoom: 12,
minzoom: 5
});
map.setTerrain({ source: "terrain" });
});
// Add navigation control
map.addControl(new maplibregl.NavigationControl({ visualizePitch: true, showZoom: true, showCompass: true }));
</script>
</body>
</html>