My map takes up 100% width and height of the browser screen.. I have a draggable div that is super imposed over the map, I am am capturing this divs position using offset();
to get the pixel
top and left values. I would like to convert these values to latitude and longitude. Is this possible?
-
Only to the resolution of the pixel size, and only after deprojecting from Web Mercator.– VinceCommented Apr 20, 2020 at 12:35
Add a comment
|
1 Answer
You can convert a screen point to a map point using https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap and then get the latitude/longitude from that point.
-
It's worth noting, since he was using a draggable div, that
toMap
also acceptes mouse events (likedragend
) Commented Dec 24, 2020 at 18:21