Skip to content

Commit 3a69eaa

Browse files
committed
Allow default line-color when property not present.
1 parent 206396b commit 3a69eaa

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

src/stylefunction.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -639,29 +639,30 @@ export function stylefunction(
639639
}
640640
}
641641
if (type != 1 && layer.type == 'line') {
642-
color =
643-
!('line-pattern' in paint) && 'line-color' in paint
644-
? colorWithOpacity(
645-
getValue(
646-
layer,
647-
'paint',
648-
'line-color',
649-
zoom,
650-
f,
651-
functionCache,
652-
featureState
653-
),
654-
getValue(
655-
layer,
656-
'paint',
657-
'line-opacity',
658-
zoom,
659-
f,
660-
functionCache,
661-
featureState
662-
)
663-
)
664-
: undefined;
642+
if (!('line-pattern' in paint)) {
643+
color = colorWithOpacity(
644+
getValue(
645+
layer,
646+
'paint',
647+
'line-color',
648+
zoom,
649+
f,
650+
functionCache,
651+
featureState
652+
),
653+
getValue(
654+
layer,
655+
'paint',
656+
'line-opacity',
657+
zoom,
658+
f,
659+
functionCache,
660+
featureState
661+
)
662+
);
663+
} else {
664+
color = undefined;
665+
}
665666
const width = getValue(
666667
layer,
667668
'paint',

0 commit comments

Comments
 (0)