Skip to content

Commit

Permalink
Fix opacity when the attribute is provided at page load, _opacity is
Browse files Browse the repository at this point in the history
not set (setter not run), should return the attribute value if _opacity
is nullish.
  • Loading branch information
prushforth committed Sep 19, 2023
1 parent 5105086 commit 3f56b0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class MapLayer extends HTMLElement {
}

get opacity() {
return this._opacity;
return this._opacity ?? this.getAttribute('opacity');
}

set opacity(val) {
Expand Down

0 comments on commit 3f56b0c

Please sign in to comment.