FYI: version 3.14 have several fixes regarding map resizing, I think that includes fixing the issue posted here.
Hi..
I'm working with a sample
in chrome (using the dev tools and emulator) when I change the orientation of the map back and forth the map either does not render, or renders only portions of the map and controls.
Have you seen this behavior?
Andy..
We are using 3.14 and have not seen this issue lately but used to all the time. One trick we used was to not only set the autoResize to false, but also to not call map.resize or map.reposition directly in the controller on it's initial load, instead wrap them in a 100ms timeout using angular's timeout service. When we just tried to resize the map at the bottom of the controller we frequently had the same issues that everyone else seems to be having. But when we did it like below at the end of our controller function everything started working.
$timeout(function () { // resize map here if the map is loaded, else, wait til map is loaded then resize }, 100);
I normally don't like using timeouts but it seemed like in an angular app with several pages, occasionally the controller would fire things before the map ever loaded and we would get some strange issues. Our app is a single-page app using Phonegap and Angular.js plus several other libraries.
Robert Winterbottom et al - we fixed a number of things in the 3.14 release so that no "tricks" would be needed any longer for this issue (if you're using 3.14 or later).
Thanks, good to know, next time I get some free time to work on that part of the mobile app again Ill have to try to remove our hacks and see how things work.
Thanks..
Im seeing other jQuery apps having probs with the dynamic resize.. not
just the ESRI jsapi
Andrew
Bjorn,
I'm still having problems in 3.14 when loading loading a map within an iframe that is within a collapsible container. If the container is rendered to the dom and displayed to the user, the map loads fine - I can collapse and expand without issue. If the container is collapsed on initial load, when I expand the container, I get a map that looks like this:
I have worked around this before by allowing the container to render, then, after page load, collapsing the map. I remember employing some resize logic in the past, but is there a better way to accomplish this in 3.14?
Is there a resolution for this in v3.x yet? We are using v3.16 and still must work around by rendering and then collapsing, which is proving cumbersome for certain areas of our app.