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

This is a combination of 3 commits.

added getKpiVisInfo

also some css improvements

small update, added some info to user
parent ed875269
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
padding: 4px 3px 0 3px; padding: 4px 3px 0 3px;
} }
#loadGeojsonButtonsContainer { #loadGeojsonButtonsContainer {
z-index: 1003; z-index: 997;
position: absolute; position: absolute;
top: 5px; top: 5px;
left: 57px; left: 57px;
......
...@@ -127,7 +127,7 @@ export class ResultsMapComponent implements OnChanges { ...@@ -127,7 +127,7 @@ export class ResultsMapComponent implements OnChanges {
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. When it will be ready, you will need to refresh the page.",
"Geojson not ready", "Geojson not ready",
{ {
status: "danger", status: "danger",
...@@ -622,118 +622,16 @@ export class ResultsMapComponent implements OnChanges { ...@@ -622,118 +622,16 @@ export class ResultsMapComponent implements OnChanges {
} }
setLoadGeojsons() { setLoadGeojsons() {
if (this.selectedSimulation != undefined) { this.networkService.getKpiVisInfo().subscribe((res) => {
if (this.selectedSimulation["city"]["cityId"] == "amsterdam") { this.loadGeojsons = [];
this.loadGeojsons = [ res.forEach((but) => {
{ this.loadGeojsons.push({
response: undefined,
buttonValue: "bikeability",
buttonLabel: "bikeability",
},
{
response: undefined,
buttonValue: "bikeIntensity",
buttonLabel: "bike Intensity",
},
{
response: undefined,
buttonValue: "bikeSafety",
buttonLabel: "bike Safety",
},
{
response: undefined,
buttonValue: "pollution",
buttonLabel: "pollution",
},
];
} else if (this.selectedSimulation["city"]["cityId"] == "bilbao") {
console.log(
"%c buttons set might not be the right ones for bilbao",
"background: indianred; font-weight: bold; color: black; font-family: serif; padding: 0 10px;"
);
this.loadGeojsons = [
{
response: undefined,
buttonValue: "bikeability",
buttonLabel: "bikeability",
},
{
response: undefined,
buttonValue: "bikeIntensity",
buttonLabel: "bike Intensity",
},
{
response: undefined,
buttonValue: "bikeSafety",
buttonLabel: "bike Safety",
},
{
response: undefined,
buttonValue: "pollution",
buttonLabel: "pollution",
},
];
} else if (this.selectedSimulation["city"]["cityId"] == "helsinki") {
this.loadGeojsons = [
{
response: undefined,
buttonValue: "congestionsAndBottlenecks",
buttonLabel: "congestions And Bottlenecks",
},
{
response: undefined, response: undefined,
buttonValue: "harbourAreaTrafficFlow", buttonValue: but["buttonValue"],
buttonLabel: "harbour Area Traffic Flow", buttonLabel: but["buttonLabel"],
}, });
{ });
response: undefined,
buttonValue: "accousticPollution",
buttonLabel: "accoustic Pollution",
},
{
response: undefined,
buttonValue: "pollution",
buttonLabel: "pollution",
},
];
} else if (this.selectedSimulation["city"]["cityId"] == "messina") {
console.log(
"%c buttons set might not be the right ones for messina",
"background: magenta; font-weight: bold; color: black; font-family: serif; padding: 0 10px;"
);
this.loadGeojsons = [
{
response: undefined,
buttonValue: "bikeability",
buttonLabel: "bikeability",
},
{
response: undefined,
buttonValue: "bikeIntensity",
buttonLabel: "bike Intensity",
},
{
response: undefined,
buttonValue: "bikeSafety",
buttonLabel: "bike Safety",
},
{
response: undefined,
buttonValue: "pollution",
buttonLabel: "pollution",
},
{
response: undefined,
buttonValue: "publicTransportUse",
buttonLabel: "public transport use",
},
];
} else {
this.toastrService.show("Unexpected value for city name.", "Error", {
status: "danger",
}); });
}
}
} }
openOverviewOfIndicators(dialog: TemplateRef<any>) { openOverviewOfIndicators(dialog: TemplateRef<any>) {
......
...@@ -91,4 +91,14 @@ export class NetworkService { ...@@ -91,4 +91,14 @@ export class NetworkService {
catchError(this.handleError) catchError(this.handleError)
); );
} }
getKpiVisInfo(): Observable<any> {
return this.httpClient.get(`${this.dssUrl}/kpi-vis-info`).pipe(
map((res) => {
return res;
}),
tapDebugApi,
catchError(this.handleError)
);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment