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

This is a combination of 2 commits.

made some improvements.

fixed a couple of inverted ones
parent 314e2940
Branches
No related tags found
No related merge requests found
...@@ -460,7 +460,12 @@ export class ResultsMapComponent implements OnChanges { ...@@ -460,7 +460,12 @@ export class ResultsMapComponent implements OnChanges {
features: [], features: [],
}); });
} else { } else {
if (this.newBrinkValuesApplied) {
if (keys[f] == "capacity") { if (keys[f] == "capacity") {
console.log(
"%c this has yet to be done, exception for capacity",
"background: maroon; color: black; font-weight: bold;"
);
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
weight: this.geoJsonStyleWeight, weight: this.geoJsonStyleWeight,
...@@ -477,7 +482,8 @@ export class ResultsMapComponent implements OnChanges { ...@@ -477,7 +482,8 @@ export class ResultsMapComponent implements OnChanges {
}), }),
onEachFeature: (feature, layer) => onEachFeature: (feature, layer) =>
layer.on({ layer.on({
mouseover: (e) => this.highlightFeature(e, feature.properties), mouseover: (e) =>
this.highlightFeature(e, feature.properties),
mouseout: (e) => this.resetFeature(e, feature.properties), mouseout: (e) => this.resetFeature(e, feature.properties),
}), }),
}); });
...@@ -485,6 +491,10 @@ export class ResultsMapComponent implements OnChanges { ...@@ -485,6 +491,10 @@ export class ResultsMapComponent implements OnChanges {
keys[f] == "dailyInternalBikeTravels" || keys[f] == "dailyInternalBikeTravels" ||
keys[f] == "pedestrianTravelTime" keys[f] == "pedestrianTravelTime"
) { ) {
console.log(
"%c this has yet to be done, exception for dailyInternalBikeTravels or pedestrianTravelTime",
"background: sienna; color: black; font-weight: bold;"
);
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
weight: this.geoJsonStyleWeight, weight: this.geoJsonStyleWeight,
...@@ -502,12 +512,12 @@ export class ResultsMapComponent implements OnChanges { ...@@ -502,12 +512,12 @@ export class ResultsMapComponent implements OnChanges {
}), }),
onEachFeature: (feature, layer) => onEachFeature: (feature, layer) =>
layer.on({ layer.on({
mouseover: (e) => this.highlightFeature(e, feature.properties), mouseover: (e) =>
this.highlightFeature(e, feature.properties),
mouseout: (e) => this.resetFeature(e, feature.properties), mouseout: (e) => this.resetFeature(e, feature.properties),
}), }),
}); });
} else { } else {
if (this.newBrinkValuesApplied) {
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
weight: this.geoJsonStyleWeight, weight: this.geoJsonStyleWeight,
...@@ -528,6 +538,80 @@ export class ResultsMapComponent implements OnChanges { ...@@ -528,6 +538,80 @@ export class ResultsMapComponent implements OnChanges {
mouseout: (e) => this.resetFeature(e, feature.properties), mouseout: (e) => this.resetFeature(e, feature.properties),
}), }),
}); });
}
} else {
// default, newBrinkValues not applied
if (keys[f] == "capacity") {
tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({
weight: this.geoJsonStyleWeight,
color: MapColors.getColorHighToLow(
feature["properties"]["capacity"],
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] == "dailyInternalBikeTravels" ||
keys[f] == "pedestrianTravelTime"
) {
tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({
weight: this.geoJsonStyleWeight,
color: MapColors.getColorHighToLow(
feature["properties"]["cityWide"]["traffic"][keys[f]] ||
feature["properties"][keys[f]],
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 (legendInverted.indexOf(keys[f]) > -1) {
// default but inverted
tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({
weight: this.geoJsonStyleWeight,
color: MapColors.getColorHighToLow(
feature["properties"] || feature["properties"][keys[f]],
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 { } else {
tmp = L.geoJSON(<any>jsonFile, { tmp = L.geoJSON(<any>jsonFile, {
style: (feature) => ({ style: (feature) => ({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment