Added track max speed color mode

+Added an option to color the tracks based on their max speed
This commit is contained in:
izawartka 2025-06-11 11:05:39 +02:00
parent 2e38241fb3
commit e023d6c9ff
2 changed files with 8 additions and 1 deletions

View File

@ -82,7 +82,9 @@ function getTrackColor(object, trackColorMode) {
return "#aa8"; return "#aa8";
} }
case "slope": case "slope":
return `url(#track-slope-${object.id})`; return `url(#track-slope-${object.id})`;
case "max-speed":
return `rgb(128, ${Math.min(255, Math.max(0, object.maxspeed * Constants.map.trackMaxSpeedScale))}, 128)`;
} }
} }

View File

@ -2,6 +2,7 @@ const Constants = {
map: { map: {
zoomSensitivity: 0.002, zoomSensitivity: 0.002,
trackSlopeScale: 10, trackSlopeScale: 10,
trackMaxSpeedScale: 1.5
}, },
parser: { parser: {
forceAutoSwitches: false, forceAutoSwitches: false,
@ -83,6 +84,10 @@ const Constants = {
{ {
id: 'slope', id: 'slope',
name: 'Slope' name: 'Slope'
},
{
id: 'max-speed',
name: 'Max speed'
} }
] ]
}; };