Initially Openlayers 3 map only draws window size

I have a popup that appears when you click on a map marker. Inside the popup, there is a minimap that shows the point the button was clicked on, but zoomed in, so a miniature of that point is on the ground. This minimap is the innerHTML element in the popup. When I first click on the marker this map element is empty, but when I resize the browser window the map appears. Also when I click on another marker the map will appear if I don't close the popup. The map just doesn't show up when the popup shows up unless I resize the browser. Does anyone know what the problem is? Thank!

+3


source to share


1 answer


I've had this problem in the past - when resizing a window. I am trying to force the resize to force it on startup.



Try to call map.getMap().updateSize();

after setting up the card in the pop-up window?

+6


source







All Articles