openfreemap-examples/index.html

26 lines
798 B
HTML
Raw Normal View History

2024-12-09 05:50:44 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>openfreemap.org maplibre-gl example</title>
<link rel="stylesheet" href="style.css">
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="width: 100%; height: 500px"></div>
<script>
const center = [11.4020009, 47.2686592];
const map = new maplibregl.Map({
style: 'https://tiles.openfreemap.org/styles/bright',
center: center,
zoom: 17.5,
container: 'map',
});
const marker = new maplibregl.Marker({color: '#ffb537'})
.setLngLat(center)
.addTo(map);
</script>
</body>
</html>