Draw tool doesn't account for changes in map position after page loads

490
2
07-07-2011 01:48 PM
KenDeeds
New Contributor III
I've set up a link below to show this.  If a page loads, and you intend to have the user use the toolbar Draw tool, and you have anything happen that changes the map position, the Draw tool does not offset to account for this.

I know how to find the offset or change of the map position, but is there a way to apply this offset to the draw tool so it draws under the cursor and accounts for the position change?

http://v39.consensusdev.com/test.php

In the link above just draw once, everything works.  Then expand the div, draw again, you'll notice the offset issue.
0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
You need to update the map's size and position. Try adding the map.resize and map.reposition to your expand and hide functions:

   function expand(){

document.getElementById('expand').style.height='110px';
    map.resize();
    map.reposition();

  }

0 Kudos
KenDeeds
New Contributor III
Thanks for the reply, did the trick.
0 Kudos