Skip to content

Commit b9dea7f

Browse files
committed
feat: added gradient border opacity (#1434)
1 parent 49a23a3 commit b9dea7f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

map/client/leaflet/GradientPath.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ function buildSVGGradientPath (geojson, coordinates) {
134134
if (stroke) {
135135
const color = _.get(stroke, 'color', 'black')
136136
const width = _.get(stroke, 'width', 1)
137+
const opacity = _.get(stroke, 'opacity', 1)
137138
if (color !== 'transparent' && width > 0) {
138139
const border = coordinates.map((p, i) => i === 0 ? `M ${p.x} ${p.y}` : `L ${p.x} ${p.y}`).join(' ')
139-
lines.push(`<path d="${border}" stroke="${color}" stroke-width="${geojson.properties.weight + 2 * width}" stroke-linecap="round" stroke-linejoin="bevel" fill="none" vector-effect="non-scaling-stroke"/>`)
140+
lines.push(`<path d="${border}" stroke="${color}" stroke-width="${geojson.properties.weight + 2 * width}" stroke-opacity="${opacity}" stroke-linecap="round" stroke-linejoin="bevel" fill="none" vector-effect="non-scaling-stroke"/>`)
140141
}
141142
}
142143
// Build the gradient path segment by segment

0 commit comments

Comments
 (0)