L = require('leaflet@1.9.4')
summits = FileAttachment("munros.json").json()
// Function to get a colored marker icon based on value
function getColor(value) {
switch (value) {
case 1: return "DarkGreen";
case 2: return "LimeGreen";
case 4: return "Olive";
case 6: return "Orange";
case 8: return "OrangeRed";
case 10: return "Red";
default: return "Gray"; // Default color for undefined values
}
}
map = {
let container = DOM.element('div', { style: `width:${width}px;height:${width}px` });
yield container;
let map = L.map(container).setView([56.5625, -4.867], 7);
let osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Add summit markers
summits.forEach(({ lat, lon, points, name, reference, Elevation }) => {
L.circleMarker([+lat, +lon], {
radius: 8,
color: getColor(points),
fillColor: getColor(points),
fillOpacity: 0.8
}).bindPopup(`Summit: ${name}<br>Reference: <a href="https://sotl.as/summits/${reference}" target="_blank">${reference}</a><br>Height: ${Elevation} m<br>Points: ${points}`)
.addTo(map);
});
}
SOTA Munros
Here is a map and list of all the munros which are SOTA summits. There are 202, out of 282 munros. This is because munros have no prominence requirements, compared to SOTA’s 150m. Perhaps this is a list of Marilyn Munros…not to be confused with Marilyn Monroe. 😅