You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Layers through a controller. An app registers its sources with an ImmersiveMapLayersController under a name (a GeoJSON file, GeoJSON data or shapes) and attaches it with .layers(_:). A layer names a source and carries only how to draw it. A prepared layer is kept on disk as the GPU takes it, so the next launch loads it without building it again.
Taps and selection on layers. Every shape has an id. A tap on one is delivered with onLayerTap, and a selection names it as .layer("id").
Faster lines. A layer's line is drawn without blending, so the GPU shades each pixel once however many segments lie on it. On the globe, where a city's lines stack on a few pixels, this took four fifths of the GPU's time. A layer's part outside the view is not drawn on the flat map.
Annotations and pins. The SwiftUI views over the map are annotations (.annotations), and the pictures the engine draws itself are pins (ImmersiveMapPin, .pins, .onPinTap, .pinSettings).
The frame of a pin..pinSettings(shape:) takes the built-in bubble, a circle, a rounded rectangle with or without a tail, a shape of your own given as a picture of it (.mask) or as a path (.path), or no frame at all (.picture). The engine makes the distance field itself. The fill under the picture (fillColor) and how far the picture is set in (contentInset) are settings.
Pins that stand still..pinSettings(spreadsApart: false) keeps every pin exactly on its coordinate. The beam of a pushed pin is denser, so it shows on water.
Faster annotations. An annotation is not measured again on an update, the annotations of Equatable items skip the ones that did not change, and only new views are inserted.
Cities..cameraPosition(.city(.paris)) opens the map over one of 71 well-known cities.
Building models by default. A bare map shows the hosted 3D building models. .modelArchive(nil) leaves them out.
Offline maps. The documentation has a section on running the map from a .pmtiles file in the app's bundle, with no network.
Two new products for bakers.ModelTileFormat reads and writes a model tile, and PMTiles has a writer of archives (PMTilesWriter). A tool that bakes a model archive links them from its own package.
Breaking: names. Markers are annotations and avatars are pins, in every type, modifier and callback. The battery and speed badges are gone. The count badge stays.
Breaking: layers.ImmersiveMapLayer no longer carries data. .layers([ImmersiveMapLayer]) on the view and ImmersiveMapSettings.layers are gone: use the controller. The still capture takes the layers' controller. A switch over a selection's kind needs a default.
Breaking: solid lines. A translucent line or outline of a layer now draws opaque, and its edge is no longer softened: .msaa() smooths it. The alpha of its color only says whether it draws.
Breaking: pin border. The outline now takes borderColor, which used to be ignored and painted black. The default is black, so an untouched map looks the same.
Breaking: model tiles, version 6. A vertex is 16 bytes in place of 20. An archive of version 5 is refused and has to be baked again.
Saved layer meshes from earlier versions are built anew once.