Incorporated review feedback

This commit is contained in:
Tobias 2022-09-19 21:06:14 +02:00
parent 39aa813ea1
commit db2c43c973

View file

@ -68,8 +68,9 @@ BR.RoutingPathQuality = L.Control.extend({
renderer: renderer, renderer: renderer,
palette: { palette: {
// normal range // normal range
0.0: '#ff0000', 0.0: 'red',
0.95: '#00ff00', 0.45: 'yellow',
0.9: 'green',
// special value for unknown // special value for unknown
1.0: '#888888', 1.0: '#888888',
}, },
@ -92,6 +93,7 @@ BR.RoutingPathQuality = L.Control.extend({
let surface = null; let surface = null;
switch (data.get('surface')) { switch (data.get('surface')) {
case 'paved': case 'paved':
case 'chipseal':
surface = 0.8; surface = 0.8;
break; break;
case 'asphalt': case 'asphalt':
@ -104,6 +106,7 @@ BR.RoutingPathQuality = L.Control.extend({
case 'sett': case 'sett':
case 'gravel': case 'gravel':
case 'pebblestone': case 'pebblestone':
case 'unpaved':
surface = 0.5; surface = 0.5;
break; break;
case 'paving_stones': case 'paving_stones':
@ -129,9 +132,9 @@ BR.RoutingPathQuality = L.Control.extend({
break; break;
case null: case null:
break; break;
default: /*default:
console.warn('unhandled surface type', data.get('surface')); console.warn('unhandled surface type', data.get('surface'));
break; break;*/
} }
// modifier tracktype; also sometimes only tracktype is available // modifier tracktype; also sometimes only tracktype is available
@ -141,8 +144,8 @@ BR.RoutingPathQuality = L.Control.extend({
if (surface === null) { if (surface === null) {
surface = 0.9; surface = 0.9;
} /* else { } /* else {
don't change don't change
} */ } */
break; break;
case 'grade2': case 'grade2':
if (surface === null) { if (surface === null) {
@ -179,10 +182,10 @@ BR.RoutingPathQuality = L.Control.extend({
// modifier for surface quality // modifier for surface quality
switch (data.get('smoothness')) { switch (data.get('smoothness')) {
case 'excellent': case 'excellent':
surface = Math.max(surface * 1.1, 1.0); surface = Math.min(surface * 1.1, 1.0);
break; break;
case 'good': case 'good':
surface = Math.max(surface * 1.05, 1.0); surface = Math.min(surface * 1.05, 1.0);
break; break;
case 'intermediate': case 'intermediate':
surface *= 0.9; surface *= 0.9;