Added track max speed color mode
+Added an option to color the tracks based on their max speed
This commit is contained in:
parent
2e38241fb3
commit
e023d6c9ff
@ -82,7 +82,9 @@ function getTrackColor(object, trackColorMode) {
|
||||
return "#aa8";
|
||||
}
|
||||
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)`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ const Constants = {
|
||||
map: {
|
||||
zoomSensitivity: 0.002,
|
||||
trackSlopeScale: 10,
|
||||
trackMaxSpeedScale: 1.5
|
||||
},
|
||||
parser: {
|
||||
forceAutoSwitches: false,
|
||||
@ -83,6 +84,10 @@ const Constants = {
|
||||
{
|
||||
id: 'slope',
|
||||
name: 'Slope'
|
||||
},
|
||||
{
|
||||
id: 'max-speed',
|
||||
name: 'Max speed'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user