Website/template/map.twig

41 lines
1.1 KiB
Twig
Raw Normal View History

2023-09-15 15:53:33 +00:00
{% include 'includes/head.twig' with {'pageTitle': 'Map'} %}
2023-09-15 15:48:05 +00:00
2023-09-18 16:10:55 +00:00
<div id="map"></div>
<a id="homeLink" href="/">Go Home</a>
2023-09-15 15:48:05 +00:00
2023-09-18 16:10:55 +00:00
<script>
2023-09-18 16:37:58 +00:00
let mapLayer = L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
attribution: '&copy; <a href="https://crss.blurryface.xyz/">CRSS</a> players',
noWrap: true
});
let spawnTown = L.marker([-36.3, -41.3])
.bindPopup('Spawn Town in Republic of Panorama');
let notchTemple = L.marker([-71, -51.8])
.bindPopup('The Temple of Notch (<a href="https://www.planetminecraft.com/project/the-shrine-of-notch/">Original Map</a>)');
let markers = L.layerGroup([
spawnTown,
notchTemple
]);
let map = L.map('map', {
zoomControl: false,
2023-09-18 16:10:55 +00:00
scrollWheelZoom: false,
doubleClickZoom: false,
2023-09-18 16:37:58 +00:00
layers: [mapLayer, markers]
2023-09-18 16:10:55 +00:00
}).setView([-36.3, -41.3], 4);
2023-09-18 16:37:58 +00:00
let baseMaps = {
"Overworld": mapLayer
};
2023-09-18 16:10:55 +00:00
2023-09-18 16:37:58 +00:00
let overlayMaps = {
"Markers": markers
};
2023-09-18 16:10:55 +00:00
2023-09-18 16:37:58 +00:00
let layerControl = L.control.layers(baseMaps, overlayMaps).addTo(map);
2023-09-18 16:10:55 +00:00
</script>
2023-09-15 15:48:05 +00:00
{% include 'includes/foot.twig' %}