website/layouts/partials/slippy-map.html

17 lines
561 B
HTML
Raw Normal View History

2023-01-23 09:07:18 +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:
'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL',
center: [{{ .lng}}, {{ .lat }}],
zoom: {{ .zoom }}
});
var marker = new maplibregl.Marker()
.setLngLat([{{ .lng }}, {{ .lat }}])
.addTo(map);
</script>