diff --git a/src/app/pages/simulation-wizard/results-map/results-map.component.ts b/src/app/pages/simulation-wizard/results-map/results-map.component.ts index 5e207387d086c1c8247b7544dbe730de2294a2dc..8257d6101e4f88999ba43c9529fea341a309b177 100644 --- a/src/app/pages/simulation-wizard/results-map/results-map.component.ts +++ b/src/app/pages/simulation-wizard/results-map/results-map.component.ts @@ -333,20 +333,9 @@ export class ResultsMapComponent implements OnChanges { private highlightFeature(e, feature) { const layer = e.target; let text = ""; - if (feature["capacity"]) { - if (feature["capacity"] == "9999.0" || feature["capacity"] == "9999") { - text += `<span style='display: inline-block; margin-bottom: 7px; font-weight: bold;'>Oops! Looks like you clicked on an transparent bus line with capacity of 9999!</span><br>`; - } - const tmp = this.limitMyDigits(feature["capacity"]); - if ("capacity" == this.checkedRadioButton) { - text += `<u><strong>capacity:</strong> ${tmp}</u><br>`; - } else { - text += `<strong>capacity:</strong> ${tmp}<br>`; - } - text += `<span style='display: inline-block; margin-bottom: 7px; color: #666'>(unrounded) ${feature["capacity"]}</span><br>`; - } if (feature["cityWide"]) { + console.log(" we have cityWide"); for (let p in feature["cityWide"]["pollution"]) { const tmp = this.limitMyDigits(feature["cityWide"]["pollution"][p]); if (p == this.checkedRadioButton) { @@ -368,13 +357,27 @@ export class ResultsMapComponent implements OnChanges { } Object.entries(feature).forEach((element) => { - const tmp = this.limitMyDigits(element[1] as number).toString(); - if (element[0] == this.checkedRadioButton) { - text += `<u><strong>${element[0]}:</strong> ${tmp}</u><br>`; + if (element[0] == "capacity") { + // exception for capacity checking for value 9999 + if (feature["capacity"] == "9999.0" || feature["capacity"] == "9999") { + text += `<span style='display: inline-block; margin-bottom: 7px; font-weight: bold;'>Oops! Looks like you clicked on an transparent bus line with capacity of 9999!</span><br>`; + } + const tmp = this.limitMyDigits(feature["capacity"]); + if ("capacity" == this.checkedRadioButton) { + text += `<u><strong>capacity:</strong> ${tmp}</u><br>`; + } else { + text += `<strong>capacity:</strong> ${tmp}<br>`; + } + text += `<span style='display: inline-block; margin-bottom: 7px; color: #666'>(unrounded) ${feature["capacity"]}</span><br>`; } else { - text += `<strong>${element[0]}:</strong> ${tmp}<br>`; + const tmp = this.limitMyDigits(element[1] as number).toString(); + if (element[0] == this.checkedRadioButton) { + text += `<u><strong>${element[0]}:</strong> ${tmp}</u><br>`; + } else { + text += `<strong>${element[0]}:</strong> ${tmp}<br>`; + } + text += `<span style='display: inline-block; margin-bottom: 7px; color: #666'>(unrounded) ${element[1]}</span><br>`; } - text += `<span style='display: inline-block; margin-bottom: 7px; color: #666'>(unrounded) ${element[1]}</span><br>`; }); if (!text.length)