Skip to content

Commit

Permalink
backport: avoid race condition, resize map once target size ok (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Dec 20, 2023
1 parent c35493b commit c947c67
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@
var prop = attrs[attr];

var map = scope.$eval(prop);
map.setTarget(element[0]);
var target = element[0];

var resizeObserver = new ResizeObserver(function() {
map.updateSize();
resizeObserver.unobserve(target);
});

map.setTarget(target);
resizeObserver.observe(target);
}
};
};
Expand Down

0 comments on commit c947c67

Please sign in to comment.