I can't display the openlayer map properly until after a window resize
问题 I set up the map like this: this.map = new Map({ target: 'map', layers: [new TileLayer({source: new OSM()}) ], view: new View({ center: [0, 0], zoom: 16, }) }); On opening the page I get this: before resizing So I open the console to make the page smaller and the map is loaded: after resizing Do you have any idea how to fix it? 回答1: A bit more than a year ago I answer a similar question. Take a look at the question Angular 6 - Rendering problems if BrowserAnimationsModule imported (Openlayers