I’m building a geographical search UI with Instantsearch.js v2.
I have a searchBox and an infiniteHits widget + a custom-built map widget based on Mapbox GL JS.
The map displays hits with clustering, so it’s not an issue to render a lot of hits. Actually, the user kind of expects to see all hits at once on the map, even if they are paginated in the infiniteHits widget.
My question is: how to achieve the following behavior?
- all hits are displayed on the map (about 4000-5000)
- only n first hits are displayed in the infiniteHits widget (default behavior for this widget)
- when I click on “show more” in the infiniteHits widget, it does not change anything on the map
- when I zoom/pan the map, it refreshes the hits shown in the infiniteHits widget (this logic is already implemented in my custom map widget)
Thanks for your help.