Go to location on map using Lat and Long coordinates

613
3
Jump to solution
08-27-2022 11:04 PM
Aeseir
by
Frequent Contributor

I am have a bunch of Lat and Long coordinates and I am trying to find the function that takes me to the location of those lat/long.

 

However i have not been able to identify the functionality that allows me to do this.

 

I have been able to do it for full address using locator but again Lat/Long has been a struggle.

0 Kudos
1 Solution

Accepted Solutions
Aeseir
by
Frequent Contributor

Ended up working out with view.goTo(). I had the target all wrong, instead of using {center:[lon,lat]}, i jut passed [lat,long].

View solution in original post

3 Replies
ThomasHoman
Frequent Contributor

Hi Aeseir,

It looks like this is a common question. Have you looked at https://community.esri.com/t5/arcgis-api-for-javascript-documents/go-to-xy-widget-for-4-6/ta-p/91569... 

Regards,

Tom

Noah-Sager
Esri Regular Contributor

That's a good thread, and this sample (it's in 3D but the concept applies to 2D as well) is also worth reviewing: https://developers.arcgis.com/javascript/latest/sample-code/scene-goto/

 

Aeseir
by
Frequent Contributor

Ended up working out with view.goTo(). I had the target all wrong, instead of using {center:[lon,lat]}, i jut passed [lat,long].