Skip to content

Commit

Permalink
no need to duplicate the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Apr 16, 2024
1 parent bacfc4c commit 01b2417
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/layers/UsePathsLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,11 @@ function addSelectedPathsLayer(map: Map, selectedPath: Path) {
width: 5,
}),
})
const lineString = new LineString(selectedPath.points.coordinates.map(c => fromLonLat(c)))
const borderFeature = new Feature(lineString)
const layer = new VectorLayer({
source: new VectorSource({
features: [borderFeature, new Feature(lineString)],
features: [new Feature(new LineString(selectedPath.points.coordinates.map(c => fromLonLat(c))))],
}),
style: f => (f == borderFeature ? borderStyle : style),
style: [borderStyle, style],
zIndex: 2,
})
layer.set(selectedPathLayerKey, true)
Expand Down

0 comments on commit 01b2417

Please sign in to comment.