Refine tracks

This includes drawing custom and labeling custom lines with JOSM, which
this commit introduces, and adding a style function to display them
differently on the map. Per Eric's feedback, I also adjusted the weight
of the lines at different zoom levels so they're not overpowering at
lower zoom levels.
This commit is contained in:
Chandler Swift 2025-11-08 17:52:05 -06:00
parent 6cd8b7e456
commit a9d7404f85
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
2 changed files with 17 additions and 13 deletions

File diff suppressed because one or more lines are too long

View file

@ -280,11 +280,22 @@
} }
} }
L.geoJSON(track, { const trackLayer = L.geoJSON(track).addTo(map);
style: { window.trackLayer = trackLayer;
color: "maroon", map.on('zoomend', function() {
}, trackLayer.setStyle(function (feature) { // zoom 15 - 21
}).addTo(map); switch (feature.properties.type) {
case 'road':
return { color: '#654321', weight: (map.getZoom() - 13) * 2 };
case 'trail':
return { color: 'maroon', weight: (map.getZoom() - 14) / 2 + 1 };
case 'shooting_lane':
return { color: 'black', weight: Math.max((map.getZoom() - 16), 1), dashArray: '8,12' };
default:
console.log("Unknown trail type: " + feature.properties.trail_type);
}
});
});
for (let stand of data.stands) { for (let stand of data.stands) {
if (stand.location) { if (stand.location) {