Hi Bricks team,
I originally posted this as a “How To” question, but after further testing this seems more like unexpected behavior, so I’m moving it to the Bugs category for clarification.
I’m using the Map (Leaflet) element with one or multiple markers (e.g. different office locations).
Observed behavior
- When markers are present
- and “Map center” is left empty
the map still falls back to a default location (e.g. Berlin), instead of centering on the marker(s).
This happens even if:
- only a single marker is set
- or multiple markers with valid coordinates are defined
Why this feels unexpected
From a user perspective, this is confusing:
- All required coordinates are already available via the markers
- Yet they are not used for the initial map view
- Instead, a hardcoded fallback location is applied silently
I understand that Leaflet technically requires an initial center and zoom, but in most Leaflet implementations this is just a temporary value and then replaced by afitBoundsbased on the marker coordinates.
Missing functionality / expected behavior
What also seems to be missing is a way to automatically center and zoom the map so that all markers are visible (Leaflet’s fitBounds behavior).
- Map center
- Initial zoom level
This makes working with multiple (or changing) markers quite impractical, especially on mobile.
Questions
- Is this behavior intended for the Leaflet map element?
- If so, what is the reasoning behind ignoring marker coordinates when no map center is set?
- If not, would it make sense to automatically center the map on the marker bounds when markers exist?
- Alternatively, could an option like
- “Auto-fit map to markers”
- “Fit bounds to markers on load”
be added?
This might be more of a UX / design issue than a technical bug, but the current behavior is hard to reason about when using markers.
Thanks a lot for taking a look ![]()