Esri / esri-leaflet-geocoder

helpers for using the ArcGIS World Geocoding Service in Leaflet
http://esri.github.io/esri-leaflet/examples/geocoding-control.html
Apache License 2.0
244 stars 101 forks source link

Geocoordinate searching shows incorrect results #310

Closed najoco closed 1 year ago

najoco commented 1 year ago

I should ask first, is searching by geocoordinates an intended feature? The search box accepts geocoordinates, but the results vary based upon the location.

I have tested on the demo site. https://developers.arcgis.com/esri-leaflet/samples/geocoding-control/

Below are some coordinates I have tested and the results. 39.812755695478145 -102.65625000000001 - Good result 57.621875380195455 -129.19921875000003 - Good result 38.13887716726548 -81.12304687500001 - Bad result 1.9551868337565232 -63.28125000000001 - Bad result 40.863679665481676 -250.31250000000003 - Bad result

gavinr commented 1 year ago

Hi, thanks for that question.

If you're trying to get addresses given a lat/long, you should use "reverse geocoding". More information on that topic is here:

https://developers.arcgis.com/documentation/mapping-apis-and-services/geocoding/reverse-geocoding/

Here is a sample on how to do that using Esri Leaflet: https://developers.arcgis.com/esri-leaflet/samples/reverse-geocoding/