Hey team, for one of my clients in Germany the map shows/centers the US if they don’t allow the browser to access their location (or haven’t accepted yet). Search query is for nearby locations (“Standorte in meiner Nähe”, which is one of their vertical prompts).
Can this default be modified to center Germany for the client (or for all clients that only have locations in Germany)?
In your locations map component, do you have displayAllResults in the noResults object set to true? This property would display the map pins for all possible results when no results are found. I’m wondering if this would default the map to center around the locations that are actually in the experience.
For the vertical full page map component, displayAllResults: false by default because our user testing showed it was a confusing experience. You can change this if it works better in this case.
I set displayAllResults to true on the locations vertical.
Search test 1: locations near me (without allowing browser location access which triggers no results).
Search test 2: A far away location that triggers no results (without allowing browser location access).
In both cases the locations’ cards now show up in the vertical search results (which is good) but unfortunately 1. The map still centers the US if the user doesn’t allow browser location access and 2. pins don’t show up at all.
Seems like this map view is a global default setting.
Some additional context:
The behavior described above sometimes comes up by just opening the locations page (no active search query) and hitting refresh a couple of times (see screenshot below).
Can this by any chance be caused by the integration / JS + iFrame init and loading speed?
The issue you’re running into with the no results might be because displayAllResults: true needs to be set in both the VerticalResults component, and in the mapConfig.noResults. It sounds like you might just have it in VerticalResults.
However, as Kristy originally mentioned, this did cause some confusion in user testing. I’d therefore recommend:
Set displayAllResults: false in your VerticalResults component (and mapConfig).
In your mapConfig, pass a default center to Mapbox using the providerOptions attribute.