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

joined dailyInternalBikeTravels and pedestrianTravelTime into a single if statement

parent 119dd0f3
Branches
No related tags found
No related merge requests found
...@@ -78,28 +78,28 @@ export class ResultsMapComponent implements OnChanges { ...@@ -78,28 +78,28 @@ export class ResultsMapComponent implements OnChanges {
this.setMapPositionAndZoom(res); this.setMapPositionAndZoom(res);
}); });
}, 50); }, 50);
// setTimeout(() => { setTimeout(() => {
// console.log( console.log(
// "%cTemporary", "%cTemporary",
// "background: peru; font-weight: bold; color: black; font-family: serif; padding: 0 10px;" "background: peru; font-weight: bold; color: black; font-family: serif; padding: 0 10px;"
// ); );
// const celkomplet: HTMLElement = document.querySelectorAll( const celkomplet: HTMLElement = document.querySelectorAll(
// ".buttons" ".buttons"
// )[0] as HTMLElement; )[0] as HTMLElement;
// celkomplet.style.display = "none"; celkomplet.style.display = "none";
// }, 825); }, 825);
// setTimeout(() => { setTimeout(() => {
// const celkomplet1: HTMLElement = document.querySelectorAll( const celkomplet1: HTMLElement = document.querySelectorAll(
// ".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; )[1] as HTMLElement;
// celkomplet1.click(); celkomplet1.click();
// }, 1000); }, 1000);
// setTimeout(() => { setTimeout(() => {
// const celkomplet2: HTMLElement = document.querySelectorAll( const celkomplet2: HTMLElement = document.querySelectorAll(
// "#loadGeojsonButtonsContainer button" "#loadGeojsonButtonsContainer button"
// )[3] as HTMLElement; )[3] as HTMLElement;
// celkomplet2.click(); celkomplet2.click();
// }, 1050); }, 1050);
// setTimeout(() => { // setTimeout(() => {
// const celkomplet3: HTMLElement = document.querySelectorAll( // const celkomplet3: HTMLElement = document.querySelectorAll(
// ".leaflet-control-layers-selector" // ".leaflet-control-layers-selector"
...@@ -481,37 +481,16 @@ export class ResultsMapComponent implements OnChanges { ...@@ -481,37 +481,16 @@ export class ResultsMapComponent implements OnChanges {
mouseout: (e) => this.resetFeature(e, feature.properties), mouseout: (e) => this.resetFeature(e, feature.properties),
}), }),
}); });
} else if (keys[f] == "dailyInternalBikeTravels") { } else if (
keys[f] == "dailyInternalBikeTravels" ||
keys[f] == "pedestrianTravelTime"
) {
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
weight: this.geoJsonStyleWeight, weight: this.geoJsonStyleWeight,
color: MapColors.getColorHighToLow( color: MapColors.getColorHighToLow(
feature["properties"]["cityWide"]["traffic"] feature["properties"]["cityWide"]["traffic"][keys[f]] ||
.dailyInternalBikeTravels || feature["properties"][keys[f]],
feature["properties"].dailyInternalBikeTravels,
keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`],
ratiosBetweenGrades,
parseInt(feature["properties"]["capacity"]) == 9999
? true
: false
),
opacity: this.geoJsonStyleOpacity,
}),
onEachFeature: (feature, layer) =>
layer.on({
mouseover: (e) => this.highlightFeature(e, feature.properties),
mouseout: (e) => this.resetFeature(e, feature.properties),
}),
});
} else if (keys[f] == "pedestrianTravelTime") {
tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({
weight: this.geoJsonStyleWeight,
color: MapColors.getColor(
feature["properties"]["cityWide"]["traffic"]
.pedestrianTravelTime ||
feature["properties"].pedestrianTravelTime,
keys[f], keys[f],
this.maxKeyValues[`maxValue_${keys[f]}`], this.maxKeyValues[`maxValue_${keys[f]}`],
ratiosBetweenGrades, ratiosBetweenGrades,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment