Select to view content in your preferred language

Map Resizing across browsers

6074
11
05-24-2010 06:59 AM
AndrewClark
Deactivated User
I'm developing JS libraries for our Corporate Web Team to use (they don't have the time to learn how to do it themselves).

I've hit and solved a few problems along the way, but now I'm stuck. I have 2 sample applications, one with a set-size DIV which is not an issue, but I also have a test app that has the map DIV at 100% Height and Width contained in a dojo content panel.

I've tried connecting to the onresize/resize event on the esri map object and on the map DIV but the event just doesn't fire (tested in IE and FF - latest versions). The only thing that works partially (in IE, not FF) is setting the onResize attribute [onresize="MapResizer();"] of the DIV associated with the esri map object.

To add further complication I cannot necessarily rely on whether the map-DIV is in a dojo container panel, or a plain old DIV.

So - all ideas welcome.

Thank you
0 Kudos
11 Replies
tongwenhuan
Emerging Contributor
i had miss same things,that resize not fire on my ext.window contains,i solved add listener ext.windows's event resize,add map.resize() and map.reposition(),thus proplem is solved. i think u do is also to add event listen on your ContentPane. you can see my do on site:http://www.tree360.cn/2013/06/1361.html
0 Kudos
JorgeFiallega
Emerging Contributor
I hooked up the resize event as explain above to the div of the map.
The event fires when resizing the window, but when I programmatically change the height or width of the div, the event does not fire.
My question is if it is suppose to fire on changes to height and width ? I would think so, otherwise just listening for window.resize event would have been enough.
0 Kudos