How to turn Once UI's Map into a globe when zoomed out and raise the basemap's buildings to their height: the projection and buildings props, camera pitch, theme-aware colours, and how controlled viewport moves travel.
From @once-ui-system/core 2.7.0, Map takes projection="globe" and buildings="3d", replacing about 40 lines of MapLibre setup.
What it used to take
The Maps without an API key page covers the flat map: markers, pins, popups and clusters. If you wanted the 3D look on top of that, you reached into onMapLoad, set the projection, added an extrusion layer for buildings, picked colours that worked in light and dark, and repainted them when the theme changed. Roughly 40 lines of MapLibre code for every app that wanted it.In 2.7.0 that is two props on Map.
projection="globe" curves the world into a globe when you zoom out and flattens it as you zoom in. MapLibre's default blue atmosphere is switched off, because it ignores your theme. The default is "mercator".
buildings="3d" extrudes the basemap's own buildings from zoom 13 and hides the flat footprints. The default is "flat".
Both types are exported from /map as and , if you want to pass them around.
MapProjection
MapBuildings
Tilt the camera, or you won't see them
Buildings are extruded straight up, so from directly above they look the same as flat ones. Give the viewport a pitch (60 is a good start) and, if you like, a bearing to turn the street grid. Both sit on MapViewport next to center and zoom, and both default to 0.
Zoom matters too: below 13 there are no 3D buildings at all, so a city overview at zoom 11 stays flat on purpose.
Colours follow the theme
You don't pick colours for the buildings. Low ones use the neutral surface, mid-height ones --brand-background-strong, and the tallest --brand-on-background-weak. The brand-hue tokens are used because the solid tokens can be plain white or black, which would wash out the skyline. They are repainted on every theme change and style swap, and the layer sits above roads and water but below labels, so street names stay readable.
Moving between places
With a controlled viewport, a jump of more than about a degree now flies out and back in (capped at 4 seconds) instead of a short glide. Combined with the globe, a move from Budapest to Lisbon reads as a journey rather than a teleport. With reduced motion turned on it is still instant.
The globe and 3D buildings are for maps people look at: a venue page, a city guide, a hero. For a map people work with, such as search results with pins and a list beside it, flat usually reads faster, and pins don't get hidden behind towers. Both props default to off for that reason, so turn them on where the view is the point.