Different colours for widths

This commit is contained in:
Pieter Vander Vennet 2020-07-27 09:38:21 +02:00
parent 1343955f44
commit a0db36e5d3
2 changed files with 6 additions and 4 deletions

View file

@ -90,17 +90,19 @@ export class Widths extends LayerDefinition {
const width = parseFloat(properties["width:carriageway"]); const width = parseFloat(properties["width:carriageway"]);
const targetWidth = const targetWidthIgnoringPedestrians =
carWidth + carWidth +
cyclistWidth + cyclistWidth +
Math.max(0, pedestrianFlowNeeded) * this.pedestrianWidth +
parallelParkingCount * this.carWidth; parallelParkingCount * this.carWidth;
const targetWidth = targetWidthIgnoringPedestrians + Math.max(0, pedestrianFlowNeeded) * this.pedestrianWidth;
return { return {
parkingLanes: parallelParkingCount, parkingLanes: parallelParkingCount,
parkingStateKnown: parkingStateKnown, parkingStateKnown: parkingStateKnown,
width: width, width: width,
targetWidth: targetWidth, targetWidth: targetWidth,
targetWidthIgnoringPedestrians: targetWidthIgnoringPedestrians,
onewayBike: onewayBike, onewayBike: onewayBike,
pedestrianFlowNeeded: pedestrianFlowNeeded, pedestrianFlowNeeded: pedestrianFlowNeeded,
cyclingAllowed: cyclingAllowed cyclingAllowed: cyclingAllowed
@ -141,7 +143,7 @@ export class Widths extends LayerDefinition {
const props = self.calcProps(properties); const props = self.calcProps(properties);
if (props.pedestrianFlowNeeded > 0) { if (props.width >= props.targetWidthIgnoringPedestrians) {
c = "#fa0" c = "#fa0"
} }
if (props.width >= props.targetWidth || !props.cyclingAllowed) { if (props.width >= props.targetWidth || !props.cyclingAllowed) {

View file

@ -42,7 +42,7 @@
<div id="filter__selection"></div> <div id="filter__selection"></div>
</div> </div>
<div id="centermessage"></div> <div id="centermessage">Loading...</div>
<div id="bottomRight" style="display: none">ADD</div> <div id="bottomRight" style="display: none">ADD</div>
<div id="geolocate-button"></div> <div id="geolocate-button"></div>