Forum Academy Marketplace Showcase Pricing Features

Center a "list" map on current position

I have a filtered list of locations displayed on a map. The map sets the appropriate zoom so they all show.

Is there a way to zoom into area around the current location. I have tried both the zoom action, and also doing a search for locations within x miles of the current position.

Thanks again,

No we don’t have such an action, we decided the show the whole list. But if you restrict the search with the constraint you’re talking about, that should do it no?

Thanks, yes, will give that a go. Just wanted to check I was on the right lines.

Sorry, another question.

The map “zoom to nearby locations” is working nicely, and reseting back to the “full” view too.

The searches populate a repeating group, which then does a filter, and the map is sent the locations from the group (which seems to be post filter ?).

Except when there is a nil return from the search. The Repeating Group is empty, which is fine. But the Map gets obviously doesn’t know what to do and shows me New York as a default.

I can’t find a way to trap this and deal with it. There isn’t an option on the Map Conditional States. So I am thinking maybe I could add a dummy location to my repeating group, and hide. As a default, if it can’t find something, it should just centre on current position.

Thanks :smile:

Yeah, the we don’t show the number of markers as an option in the conditional tab as it would lead to some inconsistencies. And centering the map on the current position by default isn’t ideal either, because that means users will have to agree to share their location all the time, which is a bit much.

So… What you can do is have 2 maps, and hide the main one when the search returns nothing, and then show another one (exactly at the same place), and then you can do whatever you want with it. It would look like something like this in the conditional tab to hide it.

Thanks, I ended up putting a “Map B” on and hiding /showing based on the results.

Although I am probably not understanding how hide works. It starts off as Not Visible. Then when the “count is 0” it gets set to visible (box is ticked), and if count > 0 then it is hidden (box is unticked). It looked like it would work the other way round, but once I switched it does exactly what I want.

I know this is a very old topic, but is there now another way of not having the map centered on New York by default ?
An additional field in the settings pannel would be great to specify it :slight_smile:

Want can’t you enter another address?

The map is displaying a list of markers from a search result of a repeating group.
If the search result is empty, the map is automatically centered on New York.
If I check “set center/zoom manually” and set another address, then the map does not autozoom to display all markers. I coudn’t find any way to set the default location when the map is displaying search results that are empty

How about a condition on the map when the list is empty?

I tried but could not see any action allowing to change the address.

But this gave me an idea: I fixed the issue by adding a “do when condition is true” workflow that set the map center and zoom when the repeating group list is empty and not loading. It is not perfect (it stills flashes “New York” for a very short time) but still better :slight_smile:
If you have time to add a better solution (like a default solution), I would still be in !