Geocoding Mapbox Keywords Problem

Hi I have an application that uses Mapbox, I also use geocoding to find places and navigate by location. It worked smoothly until I tried the keyword "Nayara" in the search field.enter image description here

I get this error when I look at "Nayara" in a text field, the textFieldIsChanging delegate connects to the GeoCoding API (which is an asynchronous link, and the result is populated in a tableView). I can successfully search all other places, but not this one. Is this an error in the map window? Is this the only keyword that has problems or have any other keywords that make the application behave like this? Expert advice needed. Thanks in advance. Happy coding.

+4
source share
1 answer

When performing several asynchronous requests, it is possible that the answers will be returned in a different order from the order in which they were requested. This is especially a problem when requests take up variable time (as is the case with geocoding requests).

In this situation, the query for Nayarprobably takes longer than the query for Nayara, and the difference is enough for the results to fail, so the response Nayaroverwrites Nayarathe dropdown in the user interface.

debounce (, API, ) , , , .

: https://github.com/mapbox/react-geocoder/pull/9

+1

Source: https://habr.com/ru/post/1695203/


All Articles