AnsweredAssumed Answered

Coordinate offset when the map div is repositioned

Question asked by yramseie@csc.com on Sep 1, 2016
Latest reply on Sep 1, 2016 by timw1984

Hi, we are experiencing the following problem with Esri's Javascript API 4:

 

- Consider a relatively positioned map that is placed at location x=0, y = 0 of a webpage. Now, if for some reason, the map is repositioned to let's say y = 50px (for example: We use a collapsible header div of 50px in height which is initially set to display:none,  and we expand this div (display: block) so the map is moved 50px further down the page)

 

Now, if we click for example a point of a feature layer to open the popup, you need to click 50px beyond the point because somehow the coordinates are messed up internally.

 

As soon as you resize the window (and therefore resize the map), it the click coordinates will be correct again.

 

Is there any fix for that?

Outcomes