0

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?

1
  • Only to the resolution of the pixel size, and only after deprojecting from Web Mercator.
    – Vince
    Commented Apr 20, 2020 at 12:35

1 Answer 1

1

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.

1
  • It's worth noting, since he was using a draggable div, that toMap also acceptes mouse events (like dragend)
    – Dror Bogin
    Commented Dec 24, 2020 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.