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 capturing this divs position using offset()
; to get the pixel top
and left
values currently.
My goals would be to convert these values to latitude
and longitude
... Could something like this be possible?
Cam,
Have you considered map.toMap(ScreenPoint)?
https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#tomap
Thanks, I thought that may have been depreciated.
So how may that apply to the below scenario for instance?
Cam,
Not sure what gave you that idea. The application would simply be:
var point = map.toMap(new ScreenPoint(coordinatesBx,coordinatesBy));
console.log("Lat: " + point.getLatitude() + ", Lon: " + point.getLongitude());
Gotchya. It is reported Uncaught ReferenceError: ScreenPoint is not defined
did you add the require for the ScreenPoint class?
For some reason I am having a hard time in getting the import to resolve; is there a specific order this one should be called?
Cam,
Are you using 4.x or 3.x?
Yes, 4.x.. tried to add that as a tag in OP. Is there a similar approach in 4.x?