Skip to content

Commit

Permalink
style by corridor completeness
Browse files Browse the repository at this point in the history
as before
  • Loading branch information
Nate-Wessel committed Dec 30, 2024
1 parent f8faf97 commit ada6d81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions frontend/src/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,19 @@ const styles = {
type:'circle',
paint:{
'circle-radius': 8,
'circle-color': 'red',
'circle-color': ['get','color'],
'circle-opacity': 0.2,
'circle-stroke-width': 2,
'circle-stroke-color': 'red'
'circle-stroke-color': ['get','color']
}
},
lines: {
id:'corridor-links',
type:'line',
paint:{'line-width': 3, 'line-color': 'black'},
paint:{
'line-width': 3,
'line-color': ['get','color']
},
layout: {'line-cap': 'round'}
}
},
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/corridor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ export class Corridor extends Factor {
type: 'MultiLineString',
coordinates: this.links.map(link=>link.geometry.coordinates)
},
properties: {}
properties: { 'color': this.isComplete ? 'green' : 'red' }
}
}
get geojsonFeaturesPoint(){
return this.intersections.map(i=>i.geojson)
return this.intersections.map( i => {
let feature = i.geojson
feature.properties.color = this.isComplete ? 'green' : 'red'
return feature
} )
}
addIntersection(intersection,logActivity){
console.assert(intersection instanceof Intersection)
Expand Down

0 comments on commit ada6d81

Please sign in to comment.