Skip to content

Commit

Permalink
Merge pull request #2199 from goat-community/main
Browse files Browse the repository at this point in the history
Merging hot fix
  • Loading branch information
EPajares authored May 2, 2023
2 parents ae5c1a9 + 59be535 commit d208fd7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
14 changes: 12 additions & 2 deletions app/client/src/components/layers/edit/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ export default {
name: "Edit Layer",
displayInLayerList: false,
source: new VectorSource({ wrapX: false }),
zIndex: 10,
// zIndex: 10,
style: getEditStyle("editable"),
queryable: true
});
Expand All @@ -896,7 +896,6 @@ export default {
displayInLayerList: false,
source: new VectorSource({ wrapX: false }),
style: getEditStyle("visualization"),
zIndex: 10,
queryable: true
});
visualizationEditLayer
Expand Down Expand Up @@ -1039,30 +1038,41 @@ export default {
if (layer === "other") {
features.forEach(feature => {
if (feature.get("oneway") !== undefined) {
this.visualizationEditLayer.setZIndex(9);
feature.setId(`way_${feature.getId()}`);
feature.set("layerName", "way");
} else if (feature.get("building_id") !== undefined) {
this.visualizationEditLayer.setZIndex(9);
feature.setId(`building_${feature.getId()}`);
feature.set("layerName", "building");
} else if (feature.get("opening_hours") !== undefined) {
this.visualizationEditLayer.setZIndex(10);
feature.setId(`poi_${feature.getId()}`);
feature.set("layerName", "poi");
}
});
this.visualizationEditLayer.getSource().addFeatures(features);
} else {
console.log(index);
if (index === 1 && layer === "building") {
this.editLayer.setZIndex(9);
layer = "population";
this.bldEntranceLayer.getSource().clear();
this.bldEntranceLayer.getSource().addFeatures(features);
return;
}
if (layer === "way") {
this.editLayer.setZIndex(9);
}
features.forEach(feature => {
feature.setId(`${layer}_${feature.getId()}`);
feature.set("layerName", layer);
});
this.editLayer.getSource().addFeatures(features);
if (layer === "poi") {
this.editLayer.setZIndex(10);
this.poiModifiedFeatures = features;
this.turnOnAndLockPoiTreeNode(features, "add");
}
Expand Down
29 changes: 22 additions & 7 deletions app/client/src/style/OlStyleDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ export function poisEditStyle(feature, resolution, type) {
color: color,
width: 2
})
})
}),
zIndex: 10
});
}

Expand Down Expand Up @@ -550,7 +551,8 @@ export function waysNewRoadStyle(type) {
stroke: new OlStroke({
color: type === "visualization" ? "rgba(79, 79, 79, 0.64)" : "#6495ED",
width: 4
})
}),
zIndex: 8
});
return [style];
}
Expand All @@ -560,23 +562,26 @@ export function waysNewBridgeStyle(type) {
stroke: new OlStroke({
color: type === "visualization" ? "rgba(79, 79, 79, 0.64)" : "#FFA500",
width: 4
})
}),
zIndex: 8
});
return [style];
}

export function buildingStyleWithPopulation() {
export function buildingStyleWithPopulation(type) {
return new OlStyle({
fill: new OlFill({
color: "rgb(0,128,0, 0.7)"
})
color: type === "visualization" ? "rgb(0,128,0, 0.7)" : "#FFA500"
}),
zIndex: 9
});
}
export function buildingStyleWithNoPopulation() {
return new OlStyle({
fill: new OlFill({
color: "#FF0000"
})
}),
zIndex: 9
});
}

Expand Down Expand Up @@ -661,7 +666,17 @@ export function editStyleFn(type) {
if (isCompleted === true && hasEntranceFeature === true) {
strokeOpt.color = "rgb(0,128,0, 0.7)";
fillOpt.color = "rgb(0,128,0, 0.7)";
} else {
strokeOpt.color =
type === "visualization"
? "rgba(79, 79, 79, 0.64)"
: "rgb(235, 64, 52, 0.7)";
fillOpt.color =
type === "visualization"
? "rgba(79, 79, 79, 0.64)"
: "rgb(235, 64, 52, 0.7)";
}

const area = getArea(feature.getGeometry());
const building_levels = feature.get("building_levels") || 0;
const population = feature.get("population");
Expand Down

0 comments on commit d208fd7

Please sign in to comment.