Skip to content

Commit 84943c8

Browse files
nocny-xxieyuanqiang
and
xieyuanqiang
authored
fix(ol-layer-*): handle undefined layer opacity correctly (#425)
Co-authored-by: xieyuanqiang <[email protected]>
1 parent 8c12463 commit 84943c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/composables/useLayer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export default function useLayer<T extends Layer>(
4444
}
4545
}
4646

47-
layer.value.setOpacity(properties.opacity);
48-
layer.value.setVisible(properties.visible);
47+
layer.value.setOpacity(properties.opacity ?? 1);
48+
layer.value.setVisible(properties.visible ?? true);
4949

5050
if (!layerAdded.value) {
5151
if (layerGroup) {

0 commit comments

Comments
 (0)