Hidden map becomes currupt after browser resize

1335
3
Jump to solution
06-03-2013 06:11 AM
AndersWartiainen
New Contributor
Hello,
I have a problem with a hidden map that becomes currupt after the browser is resized.
It works fine up to version 3.2 (http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2), but from 3.3 and above, the hidden map becomes currupt.

I have created a jsFiddle to demonstrate: http://jsfiddle.net/wartiainen/kxWxb/12/
Now, here you will see that it is working fine. Hide the map with the hide button, and resize browser, the show map. All good.

Edit the html and put in http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3, run, and do the same thing as above. Then you will see that the map is no longer working. And you will find two errors in the browser debugger:
Error: Invalid negative value for <svg> attribute width="-2"
Error: Invalid negative value for <svg> attribute height="-2"

Any ideas on how to fix this?

Anders...
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
It's a bug that we will fix for the next release of the API. The bug is caused by the automatic resize logic so in the meantime you can disable this by setting autoResize to false and handling the resize logic yourself.

   var map = new window.esri.Map("regobsmap", { extent: initialExtent, slider: true, autoResize:false, nav: true });    

View solution in original post

0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
It's a bug that we will fix for the next release of the API. The bug is caused by the automatic resize logic so in the meantime you can disable this by setting autoResize to false and handling the resize logic yourself.

   var map = new window.esri.Map("regobsmap", { extent: initialExtent, slider: true, autoResize:false, nav: true });    
0 Kudos
sumitzarkar
Occasional Contributor

Hi Hutchins,

We are facing same issue with js API 3.11, although we have handled map resize manually.

We've put a quick example of this behaviour here: http://jsfiddle.net/ZM3SM/164/

But now the map extent is lost completely and we can see some error in developer tool.

:

Error: Invalid value for <circle> attribute cx="NaN"

Capture.PNG

Thanks & Regards,

Sumit Zarkar.

0 Kudos
AndersWartiainen
New Contributor
Ok, thanks for the quick reply. 😄

Anders...
0 Kudos