Coordinate offset when the map div is repositioned

684
1
09-01-2016 06:46 AM
yves_Ramseier
New Contributor

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?

0 Kudos
1 Reply
TimWitt2
MVP Alum

In 3.xx you are able to call the following Map | API Reference | ArcGIS API for JavaScript 3.17  does that work in 4.0?

0 Kudos