Describe the bug
When the component is initialised, it is not always displayed correctly. The image, the canvas, the map component and the areas are always there, but sometimes neither the div#img-mapper container nor the canvas has any height, so the areas are not displayed, it is as if they were not there. You have to refresh the page to make it work correctly.
Expected behavior
The component should initialise correctly from the beginning, without the need to refresh the page.
Screenshots


Additional context
As you can see in the image, the component is placed inside a container with a grey background, as the content has no height, the coloured container has no height either. Although the image is visible.
Describe the bug
When the component is initialised, it is not always displayed correctly. The image, the canvas, the map component and the areas are always there, but sometimes neither the div#img-mapper container nor the canvas has any height, so the areas are not displayed, it is as if they were not there. You have to refresh the page to make it work correctly.
Expected behavior
The component should initialise correctly from the beginning, without the need to refresh the page.
Screenshots


Additional context
As you can see in the image, the component is placed inside a container with a grey background, as the content has no height, the coloured container has no height either. Although the image is visible.