Skip to content

Commit

Permalink
[maps] fix 'by value' map does not fill dashboard panel on initial pa…
Browse files Browse the repository at this point in the history
…ge load in 8.10 (elastic#165326)

Fixes elastic#165183

### Test instructions
1) install any sample data set
2) open new dashboard
3) Use "Add panel" buttons to add by-value map with only base map layer
4) Ensure map tiles fill entire map panel in dashboard

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 168412b)
  • Loading branch information
nreese committed Aug 31, 2023
1 parent 39b7ebe commit 293e7a4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ export class MbMap extends Component<Props, State> {
}
});
mbMap.on('load', () => {
emptyImage = new Image();
// Map instance automatically resizes when container size changes.
// However, issues may arise if container resizes before map finishes loading.
// This is occuring when by-value maps are used in dashboard.
// To prevent issues, resize container after load
mbMap.resize();

emptyImage = new Image();
emptyImage.src =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=';
emptyImage.crossOrigin = 'anonymous';
Expand Down

0 comments on commit 293e7a4

Please sign in to comment.