0
votes

I am trying to put a map from Openlayers 3 into a stack container which is being supplied by Dojo. But apparently there is no map being displayed until one resizes the main (browser) window.

There are no obvious errors on the Javascript console.

I made a jsfiddle: http://jsfiddle.net/q989r/

If I create the map in the same way but without all the Dojo stuff it works. I have also tried to put a distinct DIV#map for the map within DIV#center2D.

I found this similar issue: Dojo stackContainer is not displaying children until window resize but in these answers their suggestions are based on the fact that the ContentPane is created programatically which is not the case here. Anyway a

dijit.byId('view2d').startup()

nor a

dijit.byId('view2d').resize()

did not help.

So what am I probably missing? This is intended to work, right?

1

1 Answers

0
votes

It appears that there is some strange logic (maybe bug) with Dojo containers that are not visible (this hint came from the Dojo IRC @neekfenwick):

Changing the order of the Applicationstack.forward() and createMap() calls did the trick. You can find an updated and working fiddle here: http://jsfiddle.net/q989r/1/