Skip to content
Snippets Groups Projects
Commit 4ca66227 authored by Olabarrieta Palacios, Ignacio's avatar Olabarrieta Palacios, Ignacio
Browse files
parents b0ed7fa3 f2c8e1a4
No related branches found
No related tags found
No related merge requests found
Showing
with 395 additions and 236 deletions
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
" "
> >
<nb-card-body class="single-sim"> <nb-card-body class="single-sim">
<span> <span class="text-name">
{{ simulation.name }} {{ simulation.name }}
<nb-icon <nb-icon
[icon]=" [icon]="
...@@ -53,9 +53,7 @@ ...@@ -53,9 +53,7 @@
> >
</nb-icon> </nb-icon>
</span> </span>
<span class="subtitle-2 text-description">{{ <span class="text-description">{{ simulation.description }}</span>
simulation.description
}}</span>
<button <button
*ngIf="selectedSimulation == simulation; else elseBlock" *ngIf="selectedSimulation == simulation; else elseBlock"
nbButton nbButton
...@@ -65,17 +63,23 @@ ...@@ -65,17 +63,23 @@
> >
selected selected
</button> </button>
<span
class="subtitle-2 text-hint"
[@socketStatusAnimation]="simulation.animationState"
(@socketStatusAnimation.done)="onAnimationEventDone($event, i)"
(@socketStatusAnimation.start)="onAnimationEventStart($event, i)"
></span>
<ng-template #elseBlock> <ng-template #elseBlock>
<button nbButton status="primary" (click)="onSelect(simulation)"> <button nbButton status="primary" (click)="onSelect(simulation)">
select select
</button> </button>
</ng-template> </ng-template>
<span
class="text-duration"
*ngIf="
simulation.duration != undefined;
else elseSimulationDurationBlock
"
>
{{ simulation.duration }}
</span>
<ng-template #elseSimulationDurationBlock>
<span class="text-duration"> no data about duration </span>
</ng-template>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card>
</section> </section>
...@@ -308,8 +312,9 @@ ...@@ -308,8 +312,9 @@
nbTooltip="This button will run Preprocess Data, Generate Population, Generate Travel Demand Model and Run the Simulation. GET http://localhost:8082/traffic-simulation/simulation/{id}/run" nbTooltip="This button will run Preprocess Data, Generate Population, Generate Travel Demand Model and Run the Simulation. GET http://localhost:8082/traffic-simulation/simulation/{id}/run"
[disabled]="!selectedSimulation || runSimulationBtnDisabled" [disabled]="!selectedSimulation || runSimulationBtnDisabled"
> >
Run simulation</button Run simulation
><nb-icon </button>
<!-- <nb-icon
[icon]=" [icon]="
runSimulation.status == 'running' runSimulation.status == 'running'
? 'loader-outline' ? 'loader-outline'
...@@ -329,7 +334,7 @@ ...@@ -329,7 +334,7 @@
[ngClass]="{ 'icon-spin': runSimulation.status == 'running' }" [ngClass]="{ 'icon-spin': runSimulation.status == 'running' }"
class="icon" class="icon"
> >
</nb-icon> </nb-icon> -->
</div> </div>
<div class="mb-2 button-envelope"> <div class="mb-2 button-envelope">
<button <button
......
...@@ -100,20 +100,22 @@ ...@@ -100,20 +100,22 @@
align-items: center; align-items: center;
padding-top: 0.25rem; padding-top: 0.25rem;
padding-bottom: 0.25rem; padding-bottom: 0.25rem;
span { span.text-name {
margin-right: 15px;
min-width: 280px; min-width: 280px;
} margin-right: 15px;
span.text-hint {
min-width: 210px;
} }
span.text-description { span.text-description {
min-width: 220px; min-width: 220px;
margin-right: 15px;
} }
button { button {
margin-right: 15px; margin-right: 15px;
min-width: 112px; min-width: 112px;
} }
span.text-duration {
min-width: 220px;
flex-grow: 1;
}
} }
span.text-hint, span.text-hint,
span.text-description { span.text-description {
...@@ -153,6 +155,34 @@ ...@@ -153,6 +155,34 @@
} }
} }
@media screen and (max-width: 1000px) {
.nb-card {
margin-top: 0.75rem !important;
.single-sim {
display: flex;
flex-wrap: wrap;
> * {
margin-bottom: 0.25rem;
}
span {
width: 100%;
}
span.text-name {
margin-right: 0px;
}
span.text-description {
margin-right: 0px;
}
button {
margin-right: 0px;
}
button {
order: 4;
}
}
}
}
.icon { .icon {
margin-left: 0.25em; margin-left: 0.25em;
margin-right: 0.3em; margin-right: 0.3em;
......
...@@ -372,12 +372,10 @@ export class ExistingSimulationsComponent implements OnInit { ...@@ -372,12 +372,10 @@ export class ExistingSimulationsComponent implements OnInit {
); );
let startTime, endTime; let startTime, endTime;
startTime = new Date(); startTime = new Date();
console.log("🚀☢ ~ this.selectedSimulation", this.selectedSimulation);
this.simulationService this.simulationService
.getCalculateKPIs(this.selectedCity.cityId, this.selectedSimulation.id) .getCalculateKPIs(this.selectedCity.cityId, this.selectedSimulation.id)
.subscribe( .subscribe(
(res) => { (res) => {
console.log("🚀☢ ~ res", res);
this.calculateKPIS.status = ""; this.calculateKPIS.status = "";
endTime = new Date(); endTime = new Date();
let timeDiff = endTime - startTime; let timeDiff = endTime - startTime;
...@@ -425,10 +423,6 @@ export class ExistingSimulationsComponent implements OnInit { ...@@ -425,10 +423,6 @@ export class ExistingSimulationsComponent implements OnInit {
// rudimentary way of concincing our-spider-chart to redownload evaluated json // rudimentary way of concincing our-spider-chart to redownload evaluated json
this.selectedSimulationToEmit.emit(undefined); this.selectedSimulationToEmit.emit(undefined);
setTimeout(() => { setTimeout(() => {
console.log(
"🚀☢ ~ this.selectedSimulation.id.toString()",
this.selectedSimulation
);
this.selectedSimulationToEmit.emit(this.selectedSimulation); this.selectedSimulationToEmit.emit(this.selectedSimulation);
this.showToast(`Updating spider chart.`, "Info", "info"); this.showToast(`Updating spider chart.`, "Info", "info");
}, 0); }, 0);
......
...@@ -27,4 +27,7 @@ ...@@ -27,4 +27,7 @@
} }
} }
} }
a {
text-decoration: none;
}
} }
...@@ -98,7 +98,7 @@ export class OurSpiderChartComponent implements OnChanges { ...@@ -98,7 +98,7 @@ export class OurSpiderChartComponent implements OnChanges {
values_B.push(entry[1] as string); values_B.push(entry[1] as string);
} }
} else { } else {
console.log("🚀☢ Setting 0"); console.log("🚀☢ Setting 0 for ", entry[0]);
if (j == 0) { if (j == 0) {
values_A.push(0); values_A.push(0);
} else if (j == 1) { } else if (j == 1) {
......
// legendInverted are those who 'more is better'
export const legendInverted: string[] = [
'infra', 'speed', 'bikeability_safety', 'capacity'
]
// ratiosBetweenGrades are used for legend
export const ratiosBetweenGrades: number[] = [25.6, 12.8, 6.4, 3.2, 1.6];
...@@ -14,18 +14,46 @@ ...@@ -14,18 +14,46 @@
<div id="loadGeojsonButtonsContainer"> <div id="loadGeojsonButtonsContainer">
<button <button
nbButton nbButton
status="primary"
size="small" size="small"
(click)="onLoad(l)" (click)="onLoadClick(l.buttonLabel)"
nbTooltip="Select a simulation in order to use this button. GET http://localhost:8083/dss/geojson/{id}/selectedKpi" nbTooltip="Select a simulation in order to use this button. GET http://localhost:8083/dss/geojson/{id}/selectedKpi"
[disabled]="selectedSimulation == undefined" [disabled]="selectedSimulation == undefined"
[nbSpinner]="geojsonLoading" [nbSpinner]="geojsonLoading"
[status]="clickedButton == l ? 'control' : 'primary'" [status]="selectedGeojson == l.buttonLabel ? 'control' : 'primary'"
*ngFor="let l of loadGeojsonButtons" *ngFor="let l of loadGeojsons"
> >
load {{ l }} geojson load {{ l.buttonLabel }} geojson
</button>
<button
nbButton
(click)="openOverviewOfIndicators(dialog)"
nbTooltip="click for overview of indicators"
[disabled]="selectedSimulation == undefined"
>
<nb-icon icon="info-outline"></nb-icon>
</button> </button>
</div> </div>
<ng-template #dialog let-data let-ref="dialogRef">
<nb-card>
<nb-card-header
>Overview of Indicators for {{ data | titlecase }}
</nb-card-header>
<nb-card-body>
<img
src="{{
'assets/images/overviewOfIndicators' +
data[0].toUpperCase() +
data.slice(1) +
'.png'
}}"
alt=""
/>
</nb-card-body>
<nb-card-footer>
<button nbButton (click)="ref.close()">Close</button>
</nb-card-footer>
</nb-card>
</ng-template>
</div> </div>
<div id="grayscaleInput"> <div id="grayscaleInput">
<input <input
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
} }
::ng-deep .leaflet-top.leaflet-right { ::ng-deep .leaflet-top.leaflet-right {
position: relative; position: relative;
top: 37px; top: 42px;
} }
#grayscaleInput { #grayscaleInput {
background: #fffd; background: #fffd;
......
import { Component, Input } from "@angular/core"; import { Component, Input, TemplateRef, OnChanges } from "@angular/core";
import * as L from "leaflet"; import * as L from "leaflet";
import { SimulationService } from "../utils/services/simulation.service"; import { SimulationService } from "../utils/services/simulation.service";
import * as MapColors from "./map-colors-local"; import * as MapColors from "./map-colors-local";
import { NbToastrService } from "@nebular/theme"; import { legendInverted, ratiosBetweenGrades } from "./results-map-settings";
import { NbToastrService, NbDialogService } from "@nebular/theme";
import { Simulation } from "../utils/data/simulation"; import { Simulation } from "../utils/data/simulation";
@Component({ @Component({
...@@ -10,7 +11,7 @@ import { Simulation } from "../utils/data/simulation"; ...@@ -10,7 +11,7 @@ import { Simulation } from "../utils/data/simulation";
templateUrl: "./results-map.component.html", templateUrl: "./results-map.component.html",
styleUrls: ["./results-map.component.scss"], styleUrls: ["./results-map.component.scss"],
}) })
export class ResultsMapComponent { export class ResultsMapComponent implements OnChanges {
public map: L.Map; public map: L.Map;
options = { options = {
layers: [ layers: [
...@@ -24,25 +25,37 @@ export class ResultsMapComponent { ...@@ -24,25 +25,37 @@ export class ResultsMapComponent {
}; };
mapLegend = new L.Control({ position: "bottomright" }); mapLegend = new L.Control({ position: "bottomright" });
radioButtonLayersControl: any; radioButtonLayersControl: any;
loadGeojsons: Object[] = [
{
response: undefined,
buttonLabel: "bikeability",
},
{
response: undefined,
buttonLabel: "bikeIntensity",
},
{
response: undefined,
buttonLabel: "bikeSafety",
},
{
response: undefined,
buttonLabel: "pollution",
},
];
checkedRadioButton: string = ""; checkedRadioButton: string = "";
geoJsonStyleWeight: number = 5; geoJsonStyleWeight: number = 5;
geoJsonStyleOpacity: number = 0.8; geoJsonStyleOpacity: number = 0.8;
maxKeyValues: Object = {}; maxKeyValues: Object = {};
ratiosBetweenGrades: number[] = [25.6, 12.8, 6.4, 3.2, 1.6];
grayscale: any = 50; grayscale: any = 50;
geojsonLoading: boolean = false; geojsonLoading: boolean = false;
@Input() selectedSimulation: Simulation; @Input() selectedSimulation: Simulation;
clickedButton: string = ""; selectedGeojson: string = "";
loadGeojsonButtons: string[] = [
"bikeability",
"bikeIntensity",
"bikeSafety",
"pollution",
];
constructor( constructor(
private simulationService: SimulationService, private simulationService: SimulationService,
private toastrService: NbToastrService private toastrService: NbToastrService,
private dialogService: NbDialogService
) {} ) {}
onMapReady(map: L.Map) { onMapReady(map: L.Map) {
this.map = map; this.map = map;
...@@ -57,7 +70,7 @@ export class ResultsMapComponent { ...@@ -57,7 +70,7 @@ export class ResultsMapComponent {
// ); // );
// const celkomplet: HTMLElement = document.querySelectorAll( // const celkomplet: HTMLElement = document.querySelectorAll(
// ".ng-tns-c441-0.appearance-filled.size-medium.shape-rectangle.status-primary.ng-star-inserted.nb-transition" // ".ng-tns-c441-0.appearance-filled.size-medium.shape-rectangle.status-primary.ng-star-inserted.nb-transition"
// )[6] as HTMLElement; // )[1] as HTMLElement;
// celkomplet.click(); // celkomplet.click();
// }, 995); // }, 995);
// setTimeout(() => { // setTimeout(() => {
...@@ -72,21 +85,57 @@ export class ResultsMapComponent { ...@@ -72,21 +85,57 @@ export class ResultsMapComponent {
// }, 1000); // }, 1000);
} }
onLoad(selectedKpi: string) { onLoadClick(selectedKpi: string) {
this.clickedButton = selectedKpi; this.selectedGeojson = selectedKpi;
this.resetLayersAndButton();
this.setMapZoom(); this.setMapZoom();
if (this.radioButtonLayersControl) if (this.radioButtonLayersControl)
this.radioButtonLayersControl.remove(this.map); this.radioButtonLayersControl.remove(this.map);
this.loadGeojsons.forEach((geojson, index) => {
if (geojson["buttonLabel"] == selectedKpi) {
if (this.loadGeojsons[index]["response"] == undefined) {
this.toastrService.show("This might take a while", "Info", { this.toastrService.show("This might take a while", "Info", {
status: "info", status: "info",
}); });
this.geojsonLoading = true; this.geojsonLoading = true;
this.simulationService this.simulationService
.getGeojson(this.selectedSimulation["id"].toString(), selectedKpi) .getGeojson(this.selectedSimulation["id"].toString(), selectedKpi)
.subscribe( .subscribe((res) => {
(res) => { this.loadGeojsons[index]["response"] = res;
this.handleResponse(
selectedKpi,
this.loadGeojsons[index]["response"]
);
}),
(error) => {
this.toastrService.show(
error["message"],
"Error Getting Geojson",
{
status: "danger",
}
);
this.geojsonLoading = false;
};
} else {
this.handleResponse(
selectedKpi,
this.loadGeojsons[index]["response"]
);
}
}
});
}
handleResponse(selectedKpi, res) {
this.loadGeojsons.forEach((geojson, index) => {
if (geojson["buttonLabel"] == selectedKpi) {
this.loadGeojsons[index]["response"] = res;
}
});
if (res["message"] == "Calculating...") { if (res["message"] == "Calculating...") {
this.toastrService.show( this.toastrService.show(
"Server says: Calculating the KPI visualization. GEOJSON loading will not be completed.", "Server says: Calculating the KPI visualization. GEOJSON loading will not be completed.",
...@@ -153,35 +202,20 @@ export class ResultsMapComponent { ...@@ -153,35 +202,20 @@ export class ResultsMapComponent {
this.map.addControl(this.radioButtonLayersControl); this.map.addControl(this.radioButtonLayersControl);
this.addListenerToRadioButtonLayersControl(); this.addListenerToRadioButtonLayersControl();
this.geojsonLoading = false; this.geojsonLoading = false;
},
(error) => {
this.toastrService.show(error["message"], "Error Getting Geojson", {
status: "danger",
});
this.geojsonLoading = false;
}
);
} }
// LEGEND
setLegend(legendType) { setLegend(legendType) {
if (this.map != undefined && legendType == undefined) {
this.map.removeControl(this.mapLegend);
return;
}
if (this.map == undefined) {
return;
}
this.mapLegend.onAdd = (map) => { this.mapLegend.onAdd = (map) => {
let direction: string; let direction: string;
if ( if (legendInverted.indexOf(legendType) == -1) {
legendType == "PM" ||
legendType == "CO2_rep" ||
legendType == "CO" ||
legendType == "CO2_TOTAL" ||
legendType == "HC" ||
legendType == "NOx" ||
legendType == "pedestrianTravelTime" ||
legendType == "bike_count" ||
legendType == "bus_count" ||
legendType == "car_count" ||
legendType == "infra" ||
legendType == "speed" ||
legendType == "bikeability_safety"
) {
direction = "lowToHigh"; direction = "lowToHigh";
} else { } else {
direction = "highToLow"; direction = "highToLow";
...@@ -191,6 +225,10 @@ export class ResultsMapComponent { ...@@ -191,6 +225,10 @@ export class ResultsMapComponent {
this.maxKeyValues["maxValue_" + legendType] == undefined || this.maxKeyValues["maxValue_" + legendType] == undefined ||
this.maxKeyValues["maxValue_" + legendType] == 0 this.maxKeyValues["maxValue_" + legendType] == 0
) { ) {
this.toastrService.info(
"Geojson not displayed because all values are undefined or zero!",
"Geojson not displayed"
);
let div = L.DomUtil.create("div"); let div = L.DomUtil.create("div");
div.innerHTML += `<p style='background:white; display: inline; font-size:17px; padding: 0 7px; background: #ff3d71'>Values for ${legendType} kpi are undefined or zero!</p>`; div.innerHTML += `<p style='background:white; display: inline; font-size:17px; padding: 0 7px; background: #ff3d71'>Values for ${legendType} kpi are undefined or zero!</p>`;
return div; return div;
...@@ -200,24 +238,19 @@ export class ResultsMapComponent { ...@@ -200,24 +238,19 @@ export class ResultsMapComponent {
const grades = [ const grades = [
0, 0,
this.limitMyDigits( this.limitMyDigits(
this.maxKeyValues["maxValue_" + legendType] / this.maxKeyValues["maxValue_" + legendType] / ratiosBetweenGrades[0]
this.ratiosBetweenGrades[0]
), ),
this.limitMyDigits( this.limitMyDigits(
this.maxKeyValues["maxValue_" + legendType] / this.maxKeyValues["maxValue_" + legendType] / ratiosBetweenGrades[1]
this.ratiosBetweenGrades[1]
), ),
this.limitMyDigits( this.limitMyDigits(
this.maxKeyValues["maxValue_" + legendType] / this.maxKeyValues["maxValue_" + legendType] / ratiosBetweenGrades[2]
this.ratiosBetweenGrades[2]
), ),
this.limitMyDigits( this.limitMyDigits(
this.maxKeyValues["maxValue_" + legendType] / this.maxKeyValues["maxValue_" + legendType] / ratiosBetweenGrades[3]
this.ratiosBetweenGrades[3]
), ),
this.limitMyDigits( this.limitMyDigits(
this.maxKeyValues["maxValue_" + legendType] / this.maxKeyValues["maxValue_" + legendType] / ratiosBetweenGrades[4]
this.ratiosBetweenGrades[4]
), ),
]; ];
...@@ -372,6 +405,16 @@ export class ResultsMapComponent { ...@@ -372,6 +405,16 @@ export class ResultsMapComponent {
for (let f = 0; f < keys.length; f++) { for (let f = 0; f < keys.length; f++) {
let tmp: Object = {}; let tmp: Object = {};
if (
this.maxKeyValues["maxValue_" + keys[f]] == undefined ||
this.maxKeyValues["maxValue_" + keys[f]] == 0
) {
tmp = L.geoJSON(<any>{
type: "FeatureCollection",
features: [],
});
} else {
if (keys[f] == "capacity") { if (keys[f] == "capacity") {
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
...@@ -380,8 +423,10 @@ export class ResultsMapComponent { ...@@ -380,8 +423,10 @@ export class ResultsMapComponent {
feature["properties"]["capacity"], feature["properties"]["capacity"],
keys[f], keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`], this.maxKeyValues[`maxValue_${keys[f]}`],
this.ratiosBetweenGrades, ratiosBetweenGrades,
parseInt(feature["properties"]["capacity"]) == 9999 ? true : false parseInt(feature["properties"]["capacity"]) == 9999
? true
: false
), ),
opacity: this.geoJsonStyleOpacity, opacity: this.geoJsonStyleOpacity,
}), }),
...@@ -401,8 +446,10 @@ export class ResultsMapComponent { ...@@ -401,8 +446,10 @@ export class ResultsMapComponent {
feature["properties"].dailyInternalBikeTravels, feature["properties"].dailyInternalBikeTravels,
keys[f], keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`], this.maxKeyValues[`maxValue_${keys[f]}`],
this.ratiosBetweenGrades, ratiosBetweenGrades,
parseInt(feature["properties"]["capacity"]) == 9999 ? true : false parseInt(feature["properties"]["capacity"]) == 9999
? true
: false
), ),
opacity: this.geoJsonStyleOpacity, opacity: this.geoJsonStyleOpacity,
}), }),
...@@ -422,8 +469,10 @@ export class ResultsMapComponent { ...@@ -422,8 +469,10 @@ export class ResultsMapComponent {
feature["properties"].pedestrianTravelTime, feature["properties"].pedestrianTravelTime,
keys[f], keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`], this.maxKeyValues[`maxValue_${keys[f]}`],
this.ratiosBetweenGrades, ratiosBetweenGrades,
parseInt(feature["properties"]["capacity"]) == 9999 ? true : false parseInt(feature["properties"]["capacity"]) == 9999
? true
: false
), ),
opacity: this.geoJsonStyleOpacity, opacity: this.geoJsonStyleOpacity,
}), }),
...@@ -441,8 +490,10 @@ export class ResultsMapComponent { ...@@ -441,8 +490,10 @@ export class ResultsMapComponent {
feature["properties"], feature["properties"],
keys[f], keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`], this.maxKeyValues[`maxValue_${keys[f]}`],
this.ratiosBetweenGrades, ratiosBetweenGrades,
parseInt(feature["properties"]["capacity"]) == 9999 ? true : false parseInt(feature["properties"]["capacity"]) == 9999
? true
: false
), ),
opacity: this.geoJsonStyleOpacity, opacity: this.geoJsonStyleOpacity,
}), }),
...@@ -453,6 +504,7 @@ export class ResultsMapComponent { ...@@ -453,6 +504,7 @@ export class ResultsMapComponent {
}), }),
}); });
} }
}
tmp["myKey"] = keys[f]; tmp["myKey"] = keys[f];
res.push(tmp); res.push(tmp);
} }
...@@ -573,12 +625,16 @@ export class ResultsMapComponent { ...@@ -573,12 +625,16 @@ export class ResultsMapComponent {
} }
setMapZoom() { setMapZoom() {
if (this.selectedSimulation != undefined) {
if (this.selectedSimulation["city"]["cityId"] == "amsterdam") { if (this.selectedSimulation["city"]["cityId"] == "amsterdam") {
this.map.setView(new L.LatLng(52.4, 4.9), 9); this.map.setView(new L.LatLng(52.4, 4.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "bilbao") { } else if (this.selectedSimulation["city"]["cityId"] == "bilbao") {
this.map.setView(new L.LatLng(43.3, -2.9), 9); this.map.setView(new L.LatLng(43.3, -2.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "helsinki") { } else if (this.selectedSimulation["city"]["cityId"] == "helsinki") {
this.map.setView(new L.LatLng(60.2, 24.9), 9); this.map.setView(
new L.LatLng(60.16005488265436, 24.920971999284017),
13
);
} else if (this.selectedSimulation["city"]["cityId"] == "messina") { } else if (this.selectedSimulation["city"]["cityId"] == "messina") {
this.map.setView(new L.LatLng(38.2, 15.6), 9); this.map.setView(new L.LatLng(38.2, 15.6), 9);
} else { } else {
...@@ -588,3 +644,39 @@ export class ResultsMapComponent { ...@@ -588,3 +644,39 @@ export class ResultsMapComponent {
} }
} }
} }
openOverviewOfIndicators(dialog: TemplateRef<any>) {
this.dialogService.open(dialog, {
context: this.selectedSimulation["city"]["cityId"],
});
}
resetLayersAndButton() {
let timeout = 100;
if (this.map != undefined) {
this.map.eachLayer((layer) => {
if (layer["feature"] != undefined) {
setTimeout(() => {
this.map.removeLayer(layer);
timeout += 50;
}, timeout);
}
});
if (this.radioButtonLayersControl)
this.radioButtonLayersControl.remove(this.map);
}
this.setLegend(undefined);
}
ngOnChanges() {
this.resetLayersAndButton();
this.selectedGeojson = "";
Object.entries(this.loadGeojsons).forEach((entry) => {
entry[1]["response"] = undefined;
});
this.setMapZoom();
}
}
src/assets/images/overviewOfIndicatorsAmsterdam.png

2.62 KiB

src/assets/images/overviewOfIndicatorsBilbao.png

4.64 KiB

src/assets/images/overviewOfIndicatorsHelsinki.png

3.87 KiB

src/assets/images/overviewOfIndicatorsMessina.png

4.14 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment