ESRI API function (REST/JAVASCRIPT) to find nearest feature of a coordinate

07-06-2020 12:14 AM
New Contributor II


I have a an array of coordinates in my JavaScript program. I am processing these coordinates in a loop.


I need to find the nearest feature of each of these coordinate. The feature I am looking for is available in a map service published in our local server. I need to find the nearest feature in the JavaScript loop itself without manual interventions.


Is there any ESRI JavaScript or REST API function available for finding the nearest feature of the selected coordinate? 


Could you please provide the API functions and detailed steps to use it?


I am using the ArcGIS JavaScript API version 3.14 (

Our ArcGIS server version is 10.2

0 Kudos
0 Replies