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

updates on load geojson buttons, style, maximum value for spider chart increased from 4 to 5.

parent 7ab34b8b
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ export class OurSpiderChartComponent implements OnChanges { ...@@ -48,7 +48,7 @@ export class OurSpiderChartComponent implements OnChanges {
}, },
ticks: { ticks: {
beginAtZero: true, beginAtZero: true,
max: 4, max: 5,
min: 0, min: 0,
stepSize: 1, stepSize: 1,
}, },
...@@ -91,7 +91,7 @@ export class OurSpiderChartComponent implements OnChanges { ...@@ -91,7 +91,7 @@ export class OurSpiderChartComponent implements OnChanges {
for (let i = 0; i < tmpLabels.length; i++) { for (let i = 0; i < tmpLabels.length; i++) {
if (tmpLabels[i] == entry[0]) { if (tmpLabels[i] == entry[0]) {
if (/^[0-4]$/.test(entry[1] as string)) { if (/^[0-5]$/.test(entry[1] as string)) {
if (j == 0) { if (j == 0) {
values_A.push(entry[1] as string); values_A.push(entry[1] as string);
} else if (j == 1) { } else if (j == 1) {
...@@ -212,7 +212,7 @@ export class OurSpiderChartComponent implements OnChanges { ...@@ -212,7 +212,7 @@ export class OurSpiderChartComponent implements OnChanges {
entries.forEach((entry) => { entries.forEach((entry) => {
for (let i = 0; i < tmpLabels.length; i++) { for (let i = 0; i < tmpLabels.length; i++) {
if (tmpLabels[i] == entry[0]) { if (tmpLabels[i] == entry[0]) {
if (/^[0-4]$/.test(entry[1] as string)) { if (/^[0-5]$/.test(entry[1] as string)) {
if (j == 0) { if (j == 0) {
values_A.push(entry[1] as string); values_A.push(entry[1] as string);
} else if (j == 1) { } else if (j == 1) {
......
...@@ -34,6 +34,7 @@ export class ResultsMapComponent implements OnChanges { ...@@ -34,6 +34,7 @@ export class ResultsMapComponent implements OnChanges {
geojsonLoading: boolean = false; geojsonLoading: boolean = false;
@Input() selectedSimulation: Simulation; @Input() selectedSimulation: Simulation;
selectedGeojson: string = ""; selectedGeojson: string = "";
extractingKeysLoopLimit: number = 3498;
constructor( constructor(
private simulationService: SimulationService, private simulationService: SimulationService,
...@@ -340,7 +341,11 @@ export class ResultsMapComponent implements OnChanges { ...@@ -340,7 +341,11 @@ export class ResultsMapComponent implements OnChanges {
public extractKeys(jsonFile) { public extractKeys(jsonFile) {
let allKeys = []; let allKeys = [];
for (let f = 0; f < jsonFile["features"].length && f < 3498; f++) { for (
let f = 0;
f < jsonFile["features"].length && f < this.extractingKeysLoopLimit;
f++
) {
let iterator; let iterator;
Object.keys(jsonFile["features"][f]["properties"]).forEach((element) => { Object.keys(jsonFile["features"][f]["properties"]).forEach((element) => {
if (!allKeys.includes(element)) { if (!allKeys.includes(element)) {
...@@ -631,6 +636,28 @@ export class ResultsMapComponent implements OnChanges { ...@@ -631,6 +636,28 @@ export class ResultsMapComponent implements OnChanges {
]; ];
} 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);
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,
buttonLabel: "bikeability",
},
{
response: undefined,
buttonLabel: "bikeIntensity",
},
{
response: undefined,
buttonLabel: "bikeSafety",
},
{
response: undefined,
buttonLabel: "pollution",
},
];
} else if (this.selectedSimulation["city"]["cityId"] == "helsinki") { } else if (this.selectedSimulation["city"]["cityId"] == "helsinki") {
this.map.setView( this.map.setView(
new L.LatLng(60.16005488265436, 24.920971999284017), new L.LatLng(60.16005488265436, 24.920971999284017),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment