Closed TMinh25 closed 3 years ago
Hi @TMinh25, I'm not sure what you're trying to do, so I just made a simple example that console logs the results. https://codesandbox.io/s/react-map-gl-geocoder-v2-onresults-example-96nve
I just read the title of the issue and figured out what you're trying to do. haha. I haven't done this before, but I think you can execute the query
function on the Mapbox geocoder object. https://github.com/mapbox/mapbox-gl-geocoder/blob/master/API.md#query
I played around with it a bit and there actually doesn't seem to be a good way to do it because results are queried as you type, so onResults gets called many times and it ends up selecting a result before you finish typing your query.
Can you give me an example for onResults props?