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:
parent
6cd8b7e456
commit
a9d7404f85
2 changed files with 17 additions and 13 deletions
File diff suppressed because one or more lines are too long
21
map.html
21
map.html
|
|
@ -280,11 +280,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
L.geoJSON(track, {
|
||||
style: {
|
||||
color: "maroon",
|
||||
},
|
||||
}).addTo(map);
|
||||
const trackLayer = L.geoJSON(track).addTo(map);
|
||||
window.trackLayer = trackLayer;
|
||||
map.on('zoomend', function() {
|
||||
trackLayer.setStyle(function (feature) { // zoom 15 - 21
|
||||
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) {
|
||||
if (stand.location) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue