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.
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?
Thanks..
Im seeing other jQuery apps having probs with the dynamic resize.. not
just the ESRI jsapi
Andrew
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.
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).
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.
Hi..
I'm working with a sample
Mobile Web Map
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..
FYI: version 3.14 have several fixes regarding map resizing, I think that includes fixing the issue posted here.
I'm also having the same problem in 3.13.
I'm at version 3.13 and am still encountering this problem. Has a fix been released?
I just saw a new version of ArcGIS Javascript API 3.6 but unfortunately the release notes does not talk anything about the bug we discussed in this thread.
Hello Kelly,when we can expect the next release of Javascript API with this bug fixed?Thanks
The underlying problem is something we'll provide a solution for at the next release. To fix this issue for now - as others have noted- you should be able to workaround this by setting autoResize to false when you create the map. Once you do this you'll have to do the work of resizing the map when the browser resizes. You mentioned that you've set autoResize to false and it's still doing the automatic resize. Can you post a test page that shows the issue?
//Create map or resize it. $('#mapPage').bind('pageshow', function (event, ui) { if (!map) {//If this is the first time the page is loaded we need to create the map createMap(); } resizeMap(); //Always resize in case the window resized while on another page }); //Run this whenever the window resizes. We can't resize when the map isn't visible because then it goes crazy when the map is shown $(window).resize(function () { if ($('#mapPage:visible').length) { resizeMap(); } });
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.