Correct me if I don’t understand your use case correctly.
- You’d have two fields:
- one address field where places would be used and return address information
- one product field that would interact with an index through the instantsearch.js library
- You want the location entered in the address field to restrict the product search.
Is that correct?
If so, you could try to have a state representing the location, and this state would be updated through the events that places emits. (all results will have a
_geoloc field that encodes the latitude and longitude of the address) You can find more about this here:
Then you could use the coordinates you saved in the state to restrict the query in instantsearch using the
aroundLatLng parameter (you can also set an
aroundRadius value if you want to). You can find more about this parameter and how to use it in instantsearch.js here:
Here’s an old demo that uses some of these concepts together: https://jsfiddle.net/wkjyev3p/10/