Skip to content
Snippets Groups Projects
Commit c73eaf90 authored by zdenko.vuk@ijs.si's avatar zdenko.vuk@ijs.si
Browse files

improved map zoom and location

parent 5c598641
Branches
No related tags found
No related merge requests found
......@@ -625,18 +625,23 @@ export class ResultsMapComponent implements OnChanges {
}
setMapZoom() {
if (this.selectedSimulation["city"]["cityId"] == "amsterdam") {
this.map.setView(new L.LatLng(52.4, 4.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "bilbao") {
this.map.setView(new L.LatLng(43.3, -2.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "helsinki") {
this.map.setView(new L.LatLng(60.2, 24.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "messina") {
this.map.setView(new L.LatLng(38.2, 15.6), 9);
} else {
this.toastrService.show("Unexpected value for city name.", "Error", {
status: "danger",
});
if (this.selectedSimulation != undefined) {
if (this.selectedSimulation["city"]["cityId"] == "amsterdam") {
this.map.setView(new L.LatLng(52.4, 4.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "bilbao") {
this.map.setView(new L.LatLng(43.3, -2.9), 9);
} else if (this.selectedSimulation["city"]["cityId"] == "helsinki") {
this.map.setView(
new L.LatLng(60.16005488265436, 24.920971999284017),
13
);
} else if (this.selectedSimulation["city"]["cityId"] == "messina") {
this.map.setView(new L.LatLng(38.2, 15.6), 9);
} else {
this.toastrService.show("Unexpected value for city name.", "Error", {
status: "danger",
});
}
}
}
......@@ -671,5 +676,7 @@ export class ResultsMapComponent implements OnChanges {
Object.entries(this.loadGeojsons).forEach((entry) => {
entry[1]["response"] = undefined;
});
this.setMapZoom();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment