JAVASCRIPT function to find nearest feature of a coordinate

07-03-2020 04:35 AM
New Contributor II



I have set of different coordinates in an excel file. I am processing this excel file through java script API. I am trying to find the nearest feature(using ESRI javascript API) corresponding to each coordinate in excel sheet. the nearest feature  I am looking for is in a map service(layer) published in arcgis server and accessible through it's rest API url.

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


I am using the arcgis javascript API version 3.14 (

0 Kudos
1 Reply
New Contributor

From my understanding neither 3.X or 4.X have the ability to do this (proximity analysis) client side out of the box. I have the same problem as you, and will likely used the REST API's Find Nearest functionality:


Edit: In your case the following may be of interest, I haven't used 3.X so I can't be sure but it sounds close to what you are looking for:


0 Kudos