mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
29 lines
525 B
HTML
29 lines
525 B
HTML
<div id="map"></div>
|
|
|
|
<script>
|
|
const map = new maplibregl.Map({
|
|
style: "https://tiles.openfreemap.org/styles/liberty",
|
|
center: [-74.5, 40],
|
|
zoom: 9,
|
|
container: "map",
|
|
});
|
|
|
|
let nav = new maplibregl.NavigationControl({showCompass:false});
|
|
map.addControl(nav, 'top-right');
|
|
|
|
|
|
let scale = new maplibregl.ScaleControl({
|
|
maxWidth: 80,
|
|
unit: 'imperial'
|
|
});
|
|
map.addControl(scale);
|
|
|
|
scale.setUnit('metric');
|
|
|
|
|
|
let marker = new maplibregl.Marker()
|
|
.setLngLat([30.5, 50.5])
|
|
.addTo(map);
|
|
</script>
|
|
|