website/layouts/shortcodes/slippy-map.html

17 lines
579 B
HTML
Raw Permalink Normal View History

2022-12-10 10:37:36 +00:00
<div class="maplibre-map" id="short-code-slippy-map"></div>
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
<script>
var map = new maplibregl.Map({
container: 'short-code-slippy-map',
style:
2023-10-22 23:23:07 +00:00
'https://api.maptiler.com/maps/streets/style.json?key=ayRTcnWkBYAiwuQ3aCCc',
2022-12-10 10:37:36 +00:00
center: [{{ .Get "lng" }}, {{ .Get "lat" }}],
zoom: {{ .Get "zoom" }}
});
var marker = new maplibregl.Marker()
.setLngLat([{{ .Get "lng" }}, {{ .Get "lat" }}])
.addTo(map);
</script>