Closed slead closed 6 years ago
we create an array of pendingSuggestions
and loop through them and call abort()
each time another key is pressed.
relevant logic: https://github.com/Esri/esri-leaflet-geocoder/blob/master/src/Controls/Geosearch.js#L314-L319
https://github.com/Esri/esri-leaflet-geocoder/blob/master/src/Classes/GeosearchCore.js#L116-L117
many thanks
Looking at the sample at https://esri.github.io/esri-leaflet/examples/geocoding-control.html with the debugger open, I can see that as the user keeps typing in the search box, the pending requests are cancelled and only the final request (once they stop typing) actually executes.
How is this handled? I'm executing the geocoding request outside of the map frame (rather than using your tool), hence I'm calling the requests manually using the
L.esri.Geocoding.geocode()
function and I'd like to emulate the "cancel pending requests" functionality.Thanks