How to convert pixel point to lat/long?

1520
3
Jump to solution
11-16-2018 03:25 PM
AbdulKhan
New Contributor II

I'm migrating an application from leaflet to esri and there's a function L.layerPointToLatLng that returns a geographical coordinate. I was wondering what's Esri equivalent? I tried using toMap from MapView and it doesn't return anywhere close to the same results.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Abdul,


  For 4.9 you just use the latitude and longitude properties, no method needed.

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Abdul,

  The value returned from toMap will be a point class with coordinates of the map (normally wkid 102100 web mercator) not wgs84. You can use the point class getLatitude and getLongitude methods to get what you are looking for.

0 Kudos
AbdulKhan
New Contributor II

Thanks for your prompt response Robert. Sounds like that would work but it looks like the getLatitude and getLongitude methods are only in version 3 of the API. I couldn't find those methods in the version 4 point class. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Abdul,


  For 4.9 you just use the latitude and longitude properties, no method needed.

0 Kudos