Drawtool problem with IE8, IE9 and 'margin-left'

528
3
04-10-2012 01:27 AM
BerndSchneiders
New Contributor
Hi,

I´ve a problem with the drawtool. If I´m using the margin-left attribute, the drawn geometries will always be shown with a offset. For example if I set the margin-left to 100px, the offset of the geometry will be 100 pixel.
This behavior occurs only on IE8 and IE9. FF and Chrome will show the geometries without a offset.
If I use padding-left instead of margin-left it works fine.

If you use this example:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/toolbar_draw.html
and modify the body style to:


    <style type="text/css">
      html, body {
        height: 100%; width: 500px; padding: 0; margin-left: 100px;
      }
    </style>

you can see the problem.

Is there any solution for this problem? Can I set somewhere a offset?

Regards,
Bernd
0 Kudos
3 Replies
derekswingley1
Frequent Contributor
Have you looked into using dijit layout widgets to layout your page?
0 Kudos
BerndSchneiders
New Contributor
The map is integrated in an external page. So I can´t use Dojo Layout.
This external page is using 'margin-left: auto' to center always the map.

Regards,
Bernd
0 Kudos
BerndSchneiders
New Contributor
I discovered a workaround. After resizing the browser window, we need to call the resize() method of the map object. This seems to update internally the margin/position of the map.
This look like that the map object does not update its margin correctly in IE8/IE9.

Bernd
0 Kudos