From af50246c7ef2329fee9dd4326963d4f88ad36c2b Mon Sep 17 00:00:00 2001 From: zdenevuk <zdenko.vuk@ijs.si> Date: Wed, 30 Nov 2022 14:16:46 +0100 Subject: [PATCH] This is a combination of 4 commits. map zoom and position now works. just a letter fixed updated temporary content apdded public transport use to messina (only) --- .../existing-simulations.component.ts | 2 +- .../results-map/results-map.component.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/pages/simulation-wizard/existing-simulations/existing-simulations.component.ts b/src/app/pages/simulation-wizard/existing-simulations/existing-simulations.component.ts index 10779fb4..71cd0947 100644 --- a/src/app/pages/simulation-wizard/existing-simulations/existing-simulations.component.ts +++ b/src/app/pages/simulation-wizard/existing-simulations/existing-simulations.component.ts @@ -422,7 +422,7 @@ export class ExistingSimulationsComponent implements OnInit { ); this.runDss.status = ""; - // rudimentary way of concincing our-spider-chart to redownload evaluated json + // rudimentary way of convincing our-spider-chart to redownload evaluated json this.selectedSimulationToEmit.emit(undefined); setTimeout(() => { this.selectedSimulationToEmit.emit(this.selectedSimulation); 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 e9e99148..761bd410 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 @@ -49,8 +49,7 @@ export class ResultsMapComponent implements OnChanges { setTimeout(() => { this.map.invalidateSize(); this.networkService.getMapInfo().subscribe((res) => { - console.log("🚀☢ ~ res", res); - this.setMapPositionAndZoom(res) + this.setMapPositionAndZoom(res); }); }, 50); // setTimeout(() => { @@ -59,7 +58,7 @@ export class ResultsMapComponent implements OnChanges { // "background: crimson; font-weight: bold; color: black; font-family: serif; padding: 0 10px;" // ); // const celkomplet: HTMLElement = document.querySelectorAll( - // ".ng-tns-c441-0.appearance-filled.size-medium.shape-rectangle.status-primary.ng-star-inserted.nb-transition" + // ".appearance-filled.size-medium.shape-rectangle.status-primary.ng-star-inserted.nb-transition" // )[1] as HTMLElement; // celkomplet.click(); // }, 995); @@ -69,7 +68,7 @@ export class ResultsMapComponent implements OnChanges { // "background: peru; font-weight: bold; color: black; font-family: serif; padding: 0 10px;" // ); // const celkomplet: HTMLElement = document.querySelectorAll( - // ".buttons.ng-tns-c441-0" + // ".buttons" // )[0] as HTMLElement; // celkomplet.style.display = "none"; // }, 1000); @@ -720,6 +719,11 @@ export class ResultsMapComponent implements OnChanges { buttonValue: "pollution", buttonLabel: "pollution", }, + { + response: undefined, + buttonValue: "publicTransportUse", + buttonLabel: "public transport use", + }, ]; } else { this.toastrService.show("Unexpected value for city name.", "Error", { @@ -765,7 +769,9 @@ export class ResultsMapComponent implements OnChanges { } setMapPositionAndZoom(res: Object) { - console.log("🚀☢ ~ res", res) - this.map.setView(new L.LatLng(0, 0), 7); + this.map.setView( + new L.LatLng(res["coordinates"]["lat"], res["coordinates"]["lon"]), + res["zoom"] + ); } } -- GitLab