On my search page, among the refinement options, I have a location field connected to Algolia Places. From what I understand, this sets the
aroundLatLng of the search. I have
aroundLatLngViaIP set to
What I would like is to be able to extract the ‘currently set’ location from this widget and display that information. For example, if a user from Houston, TX was to use my search, then their first search would search around Houston. I would like to be able to display “Searching From: Houston, Texas” somewhere on the page. And that should update when the Places input is used to choose a new location to “search from.” I would also like this to be reflected via the URL, with routing.
I’ve found that using
search.helper.lastResults.aroundLatLng sometimes (not always?) contains the latitude and longitude, so perhaps I can use that to get the information I am looking for. But I don’t know how.
I’m using instantsearch.js.