diff --git a/web-ui/src/main/resources/catalog/components/common/openlayers/olMapDirective.js b/web-ui/src/main/resources/catalog/components/common/openlayers/olMapDirective.js index d3a831bd21..0ff7a5bc36 100644 --- a/web-ui/src/main/resources/catalog/components/common/openlayers/olMapDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/openlayers/olMapDirective.js @@ -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); } }; };