Releases: mapbox/mapbox-maps-ios
v11.1.0-beta.1
Known Issues ⚠️
RasterArraySource.rasterLayers
is alwaysnil
for any source.
Workaround: useMapboxMap.sourceProperty(for:property:).value
to fetch a value ofRasterArraySource.rasterLayers
.
Features ✨ and improvements 🏁
- Expose method to get coordinate info for point(s):
MapboxMap.coordinateInfo(for:)
andMapboxMap.coordinatesInfo(for:)
. - [SwiftUI] Expose
Map.gestureHandlers()
for handling Map gesture events. - Introduce experimental
RasterArraySource
, along withRasterLayer.rasterArrayBand
. - Introduce
-emissiveStrength
attribute forFillExtrusionLayer
,HillShadeLayer
andRasterLayer
.
Bug fixes 🐞
- Fix inconsistent behavior in fill-extrusion color when using directional and ambient lights.
- Downloaded but corrupted style is now invalidated and will be downloaded again on the next load.
- Fixed missing tiles in the bottom part of the screen when looking from the mountain down to the valley.
- Do not emit slot missing warnings if style imports are not fully loaded.
- Fixed wrong dem tile selection from elevation snapshots in rare cases.
- Fixed tile flickering with enabled terrain.
- Add missing properties, i.e.
array
,values
,maxValue
,minValue
,stepValue
,metadata
for queried import schemas, if they are present in the original schema. - Exclude duplicated tileID in tileCover querying results.
- Fix race condition on repeated style transitions, when the transition fails for some layers.
- Force texture recreation in case the texture is not replaceable.
- Check for ETC texture format availability in Mac Catalyst.
- Allow style schema to control imported fragment configs.
Dependencies
- Update MapboxCommon to
24.1.0-beta.2
. - Update MapboxCoreMaps to
11.1.0-beta.1
.
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v10.16.3
Changes
- Update MapboxCoreMaps to
10.16.3
- Update MapboxCommon to
23.8.5
MapboxCoreMaps v10.16.3
Bug fixes 🐞
- Fix crash with enabled timestamps debug option
- Fix crash caused by model_collision shader compilation failure
- Fix assertion hit at TransformState::requiresLOD()
- Added processing of unknown exceptions (without RTTI some standard exceptions are processed as unknown)
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v11.0.0
Mapbox Maps SDK iOS v11 enables the Mapbox Standard Style, a new realistic 3D lighting system, building shadows and many other visual enhancements, Swift UI support, an updated ergonomic API for working with map styles and custom data, and much more! You can learn about each new feature and how to upgrade in the Migration guide. Additionally, be sure to check out our topic-by-topic documentation on our Docs website.
v11.0.0
Features ✨ and improvements 🏁
Map Styles - Documentation & Migration Guide
- Introduce the Mapbox Standard Style as the default style
- Expose new APIs for working with style importing and configuration: getStyleImports(), removeStyleImport(forImportId:), getStyleImportSchema(forImportId:), getStyleImportConfigProperties(forImportId:), setStyleImportConfigPropertiesForImportId(:configs:), getStyleImportConfigProperty(forImportId:config:), setStyleImportConfigPropertyForImportId(:config:value:)
- Introduce
Slot
struct with static properties to manage adding layers to pre-specified slots in a style import. See documentation here. - Refactor
MapboxMap.loadStyle
to cancel previous style loads when called multiple times. - New experimental
StyleManager.load(mapStyle:transition:completion)
method to loadMapStyle
inMapboxMap
, orSnapshotter
:mapboxMap.load(mapStyle: .standard(lightPreset: .dawn, showRoadLabels: false)) { _ in print("Style is loaded") }
- Add "keep-legacy-style-pack" style pack load extra option that prevents from the style package removal from the legacy storage
- Relax style parsing of an unknown style layer properties
StyleColor
- add support for all color formats as defined by Mapbox Style Spec.- Add required
id
property toSource
. After that changeid
should be specified for source upon creation:let terrainSource = RasterDemSource(id: "terrain-source") mapView.mapboxMap.addSource(terrainSource)
- Support string option in
GeoJSONSourceData
. - Allows passing
extraOptions
(which must be a valid JSON object) when creatingStylePackLoadOptions
andTilesetDescriptorOptions
. - Deprecate
MapboxMap/style
andSnapshotter/style
, from now on you can access Style APIs directly fromMapboxMap
andSnapshotter
instance.
Swift UI - Documentation & Migration Guide
Note: SwiftUI support is an experimental feature, its API may be changed until it stabilizes.
In v11 our approach to Swift UI has been updated significantly. Please see our Swift UI documentation here to get started.
- To enable or disable
safeAreaInsets
when calculating a camera's padding in every viewport, you can useMap.usesSafeAreaInsetsAsPadding(_:)
, additionally, you can add extra global safe area insets to the map using modifierMap.additionalSafeAreaInsets
- Use
MapViewAnnotation
instead ofViewAnnotation
to display view annotations in SwiftUI.Map { MapViewAnnotation(coordinate: coordinate) { Text("🏠") } .allowOverlap(false) .variableAnchors([ViewAnnotationAnchorConfig(anchor: .bottom)]) }
- Annotation groups can be created with static list of annotations. In the example below polyline annotation group displays two annotations on the same layer.
Map {
PolylineAnnotationGroup {
PolylineAnnotation(lineCoordinates: route.coordinates)
.lineColor("blue")
if let alternativeRoute {
PolylineAnnotation(lineCoordinates: alternativeRoute.coordinates)
.lineColor("green")
}
}
.lineCap(.round)
.slot("middle")
}
Map Events - Migration Guide
- Map events have been reworked:
- Now all Map events payloads are serialize-free, which brings more type safety and eliminates possible deserialization errors;
- The
MapboxMap
andSnapshotter
now exposeon
-prefixed properties that allows you to subscribe to map events viaobserve
andobserveNext
methods:mapboxMap.onCameraChanged.observe { [weak self] event in self?.camera = event.cameraState }.store(in: &cancelables) mapboxMap.onStyleLoaded.observeNext { [weak self] _ in self?.configureStyle() }.store(in: &cancelables)
- The
AnyCancelable
object returned fromobserve
andobserveNext
should be stored, otherwise the subscription will be immediately canceled; - The same
on
-prefixed properties can now be used asCombine.Publisher
:import Combine mapboxMap.onCameraChanged .debounce(for: .milliseconds(500), scheduler: DispatchQueue.main) .map(\.cameraState) .sink { [weak self] cameraState in self?.camera = cameraState }.store(in: &cancellables)
- Methods
MapboxMap.onEvery
,MapboxMap.onNext
,Snapshotter.onEvery
,Snapshotter.onNext
have been deprecated; - Methods
MapboxMap.observe
andSnapshotter.observe
have been removed.
Lights - Migration Guide
- Enable rendering of fill extrusion flood lights on the ground with fully transparent fill extrusions
- Align hillshade illumination direction with 3d lights
- Flood lighting and AO ground contribution in draped mode
- Increase rendering performance of shadows
- Refactor style Light API: introduce
AmbientLight
,DirectionalLight
,FlatLight
and methods to set them. - Introduce
hsl
,hsla
,random
expressions. - Introduce
measureLight
expression lights configuration property. - Introduce experimental
BackgroundLayer/backgroundEmissiveStrength
,CircleLayer/circleEmissiveStrength
,FillLayer/fillEmissiveStrength
,LineLayer/lineEmissiveStrength
,SymbolLayer/iconEmissiveStrength
,SymbolLayer/textEmissiveStrength
,ModelLayer/modelEmissiveStrength
,ModelLayer/modelRoughness
,ModelLayer/modelHeightBasedEmissiveStrengthMultiplier
APIs. - Introduce experimental
FillExtrusionLayer/fillExtrusionAmbientOcclusionWallRadius
,FillExtrusionLayer/fillExtrusionAmbientOcclusionGroundRadius
,FillExtrusionLayer/fillExtrusionAmbientOcclusionGroundAttenuation
,FillExtrusionLayer/fillExtrusionFloodLightColor
,FillExtrusionLayer/fillExtrusionFloodLightIntensity
,FillExtrusionLayer/fillExtrusionFloodLightWallRadius
,FillExtrusionLayer/fillExtrusionFloodLightGroundRadius
,FillExtrusionLayer/fillExtrusionFloodLightGroundAttenuation
,FillExtrusionLayer/fillExtrusionVerticalScale
APIs. - Introduce
FillExtrusionLayer.fillExtrusionRoundedRoof
,FillExtrusionLayer.fillExtrusionEdgeRadius
API. - Introduce
lineDepthOcclusionFactor
API forLineLayer
s andPolylineAnnotiationManager
.
GeoJSON and Query Rendered Features
- Expose new Style APIs for partial GeoJSON update:
MapboxMap.addGeoJSONSourceFeatures(forSourceId:features:dataId:)
MapboxMap.updateGeoJSONSourceFeatures(forSourceId:features:dataId:)
MapboxMap.removeGeoJSONSourceFeatures(forSourceId:featureIds:dataId:)
- Different data types are now used for
querySourceFeatures
andqueryRenderedFeatures
:QueriedSourceFeature
andQueriedRenderedFeature
.QueriedRenderedFeature
has a new fieldlayer
which contains the queried feature's layer id. - Remove deprecated
queryRenderedFeatures()
methods. UsequeryRenderedFeatures(with:options:completion:)
instead. - Remove deprecated
queryFeatureExtension()
method. UsegetGeoJsonClusterLeaves()
/getGeoJsonClusterChildren()
/getGeoJsonClusterExpansionZoom()
instead. - Add the
MapboxMap.resetFeatureState
method. - Add
callback
argument to theMapboxMap
methodsgetFeatureState
,setFeatureState
,removeFeatureState
. - Return
cancelable
from theMapboxMap
methods :getFeatureState
,setFeatureState
,removeFeatureState
,querySourceFeatures
,getGeoJsonClusterLeaves
,getGeoJsonClusterChildren
,getGeoJsonClusterExpansionZoom
.
Annotations - Documentation
- Introduce new Map Content Gesture System, please refer to Map Content Gestures Guide for more information and guidance.
- Added
allowOverlapWithPuck
andignoreCameraPadding
options toViewAnnotation
andMapViewAnnotation
. - Support
slot
for annotation managers and annotation groups. - New ViewAnnotation class is added to simplify work with view annotations, use it instead of
ViewAnnotationOptions
. - Support for Dynamic View Annotations. Use them to attach View annotations to any feature rendered by map, for example you can visualize additional information along the routes, areas, or points. The annotations will reposition themselves when user pans the map. Check the [ViewAnnotation](http...
v11.0.0-rc.2
Changes
Breaking changes ⚠️
Note: SwiftUI support is an experimental feature, its API may be changed until it stabilizes.
- [SwiftUI] Fixed point annotations clustering.
- [SwiftUI] Viewport inset system was refactored:
- The
Viewport.inset(...)
function was removed in favor of theViewport.padding(...)
- The
Viewport.inset(...)
previously had anignoringSafeArea
parameter which allowed developers to specify if an edge safe area inset should be accounted for in padding calculation. Starting with this version, instead of this parameter there is aMap.usesSafeAreaInsetsAsPadding(_:)
modifier that enables or disables this for all edges.
- The
Features ✨ and improvements 🏁
- Introduced
Slot
struct with static properties to manage adding layers to pre-specified slots in a style import. See documentation here. - [SwiftUI] Introduced a new
Map.additionalSafeAreaInsets(...)
modifier that adds additional global safe area insets for the map. Use them to display any UI elements on top of the map. The additional safe area will automatically be accounted for in the camera padding calculation in every Viewport. - Added
allowOverlapWithPuck
andignoreCameraPadding
options toViewAnnotation
andMapViewAnnotation
.
Bug fixes 🐞
- [SwiftUI] Fixed a bug when
Viewport.inset(...)
didn't use safe area insets on the first load. - [SwiftUI] Fixed a map basic coordinator clinging to the first subscriptions.
Dependencies
- Update MapboxCommon to
24.0.0-rc.3
. - Update MapboxCoreMaps to
11.0.0-rc.2
:
Changelog
Features ✨ and improvements 🏁
- Added
allowOverlapWithPuck
andignoreMapPadding
flags toViewAnnotationOptions
. - The SDK now avoids placing view annotations on overlapped line geometries if the current bound layer is below other annotated line layers.
Bug fixes 🐞
- Fixed flickering and wrong positions for elevated symbols.
- Updating a style layer's source will now trigger repaint.
- Fixed issue where model loading might have failed when the model used a 32-bit index buffer.
- Fixed rendering of the updated content on the map after a feature state change if terrain or globe were enabled.
- Fixed issue where view annotations would disappear on the upper parts of the screen when terrain was enabled.
- The SDK now triggers view annotation replacement if the associated layer/source gets changed.
- Fixed a bug where snapshot is rendered without 3D content.
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v10.16.2
Changes
Bug fixes 🐞
- Fix line label flickering issue by eliminating the anchor rounding error.
Dependencies
- Update MapboxCommon to
23.8.4
. - Update MapboxCoreMaps to
10.16.2
:
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v11.0.0-rc.1
Changes
Breaking changes ⚠️
MapboxMap.loadStyle
methods changed error type fromMapLoadingError
toError
.OverviewViewportStateOptions.coordinatesPadding
is renamed toOverviewViewportStateOptions.geometryPadding
.- [SwiftUI]
Viewport.overview(geometry:bearing:pitch:coordinatesPadding:maxZoom:offset:)
is renamed toViewport.overview(geometry:bearing:pitch:geometryPadding:maxZoom:offset:)
- Bearing indication on user location puck is disabled by default to reduce amount map redraws.
To re-enable bearing update rendering, setmapView.location.options.puckBearingEnabled
totrue
. - The default behavior of resetting the viewport to idle is changed. Previously viewport was reset to idle when the user touched the map for longer than 150 ms. Now it will happen when the user pans the map. If the desired behavior is different, you can disable the default by setting
mapView.viewport.options.transitionsToIdleUponUserInteraction
tofalse
and implementing any gesture that callsmapView.viewport.idle()
.
Features ✨ and improvements 🏁
- Refactor
MapboxMap.loadStyle
to cancel previous style loads when called multiple times. - New experimental
StyleManager.load(mapStyle:transition:completion)
method to loadMapStyle
inMapboxMap
, orSnapshotter
:mapboxMap.load(mapStyle: .standard(lightPreset: .dawn, showRoadLabels: false)) { _ in print("Style is loaded") }
- Support
slot
for annotation managers and annotation groups. - [SwiftUI] Annotation groups can be created with static list of annotations. In the example below polyline annotation group displays two annotations on the same layer.
Map { PolylineAnnotationGroup { PolylineAnnotation(lineCoordinates: route.coordinates) .lineColor("blue") if let alternativeRoute { PolylineAnnotation(lineCoordinates: alternativeRoute.coordinates) .lineColor("green") } } .lineCap(.round) .slot("middle") }
- [SwiftUI] Expose
transitionsToIdleUponUserInteraction
modifier.
Bug fixes 🐞
- Fix issue where 2D puck images are not getting updates.
- [SwiftUI] Fixed issue when viewport inset with safe area is calculated incorrectly.
- Fixed issue when quick interaction didn't lead to resetting viewport to
idle
.
Dependencies
- Update MapboxCommon to
24.0.0-rc.2
. - Update MapboxCoreMaps to
11.0.0-rc.1
:-
Changelog
- Features ✨ and improvements 🏁
- Update mapbox-common to v24.0.0-rc.1
- Bug fixes 🐞
- Fix the line label flickering issue by eliminating the anchor rounding error
- Honor model-emissive-strength for 3D location indicator
- Fix rendering of large/complex fill extrusion features
- Features ✨ and improvements 🏁
-
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v11.0.0-beta.6
Breaking changes ⚠️
- Style projection can be undefined for styles that do not explicitly specify it, so
MapboxMap.projection
has become optional. - View Annotation API is changed:
ViewAnnotationOptions.geometry
was removed in favor ofViewAnnotationOptions.annotatedFeature
.ViewAnnotationOptions.associatedFeatureId
was removed. UseAnnotatedFeature.layerFeature(layerId:featureId:)
withViewAnnotationOptions.annotatedFeature
to bind View Annotation to features rendered by any layer.- [SwiftUI] Use
MapViewAnnotation
instead ofViewAnnotation
to display view annotations in SwiftUI. - [SwiftUI]
MapViewAnnotation
initializer doesn't receive configuration parameters anymore. Use modifier functions to configure annotaiton:
Map { MapViewAnnotation(coordinate: coordinate) { Text("🏠") } .allowOverlap(false) .variableAnchors([ViewAnnotationAnchorConfig(anchor: .bottom)]) }
OverviewViewportStateOptions.padding
is renamed toOverviewViewportStateOptions.coordinatePadding
, theOverviewViewportStateOptions.padding
now represents the camera padding.
Features ✨ and improvements 🏁
- New ViewAnnotation class is added to simplify work with view annotations, use it instead of
ViewAnnotationOptions
. - Support for Dynamic View Annotations. Use them to attach View annotations to any feature rendered by map, for example you can visualize additional information along the routes, areas, or points. The annotations will reposition themselves when user pans the map. Check the ViewAnnotation and MapViewAnnotation documentation or the pre-built DynamicViewAnnotationExample.
- Add
MapboxMaps.camera(for:camera:coordinatesPadding:maxZoom:offset)
. - Add
MapViewDebugOptions.padding
debug option. - Add
maxZoom
andoffset
parameters toOverviewViewportStateOptions
. - Add "keep-legacy-style-pack" style pack load extra option that prevents from the style package removal from the legacy storage
- Enable rendering of fill extrusion flood lights on the ground with fully transparent fill extrusions
- Skip location and bearing updates if new value changes are under fixed epsilon
- Add cameraForCoordinates overload so that the padding for map & geometry can be specified separately.
- Disable terrain when zoom-dependent exaggeration expression evaluates to zero.
- Add support for glb 3d tiles
- Align hillshade illumination direction with 3d lights
Bug fixes 🐞
- Fix issue when transition to Overview Viewport resulted in double padding.
- [SwiftUI] Fix issue when Overview Viewport is incorrect if set as initial viewport.
- Improve handling of inlined style fragments
- Do not overwrite style URL when setting invalid style JSON
- Don't store SDK version in TileStore
Dependencies
- Update MapboxCommon to
24.0.0-beta.7
. - Update MapboxCoreMaps to
11.0.0-beta.7
.
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v11.0.0-beta.5
⚠️ Known issues ⚠️
MapboxMap.setProjection(_:)
throws an error if the underlying style doesn't define a projection or if a style hasn't completed loading yet.
Breaking changes ⚠️
- Consolidate
FetchTileFunctionCallback
andCancelTileFunctionCallback
by single typeTileFunctionCallback
.
Features ✨ and improvements 🏁
- Add a new CustomLayer API to simplify manipulation of layers with custom rendering (aka "CustomLayerHost").
- The following APIs have been promoted to stable:
LineLayer/lineDepthOcclusionFactor
,LineLayer/lineDepthOcclusionFactorTransition
,LineLayer/lineEmissiveStrength
andLineLayer/lineEmissiveStrengthTransition
SymbolLayer/iconImageCrossFade
,SymbolLayer/iconImageCrossFadeTransition
,SymbolLayer/iconEmissiveStrength
,SymbolLayer/iconEmissiveStrengthTransition
,SymbolLayer/textEmissiveStrength
andSymbolLayer/textEmissiveStrengthTransition
BackgroundLayer/backgroundEmissiveStrength
andBackgroundLayer/backgroundEmissiveStrengthTransition
CircleLayer/circleEmissiveStrength
andCircleLayer/circleEmissiveStrengthTransition
FillLayer/fillEmissiveStrength
andFillLayer/fillEmissiveStrengthTransition
AmbientLight
,DirectionalLight
and related APIs.
- Fix memory leak in SwiftUI.
- Expose
MapViewDebugOptions
in SwiftUI. - Improve the caching model for the Custom Raster Source.
- Flood lighting and AO ground contribution in draped mode
- Optimize Custom Raster source data update
- Increase rendering performance of shadows
- Relax style parsing of an unknown style layer properties
- Optimise memory usage in the fill-extrusion layer
- Improve the rendering performance of a symbol layer that uses symbol-sort-key property
- Reduce memory usage in fill-extrusion flood light and ground ambient occlusion
Bug fixes 🐞
- Fix a bug where the map would not zoom above a certain threshold on high-pitched views
- Fix crashes if 3D layers are used alone on terrain or globe without any other layer types
- Fix line layer leaking if placed behind the satellite layer
- Fix line and raster layers interop for draped mode
- Fix a crash problem that occurred when consecutive snapshot requests were made
- Correct half-texel misalignment in raster-color lookup texture sampling
- Use the system's default fraction digit setting for currency formatting
- Fix erroneous shadow map sampling of distant landmarks
- Fix incorrect level-of-detail model being chosen for trees in some scenarios
- Fix the style layer minimum and maximum zoom default values
Changes in: 11.0.0-beta.1, 11.0.0-beta.2, 11.0.0-beta.3, 11.0.0-beta.4
Dependencies
- Update MapboxCommon to
24.0.0-beta.6
. - Update MapboxCoreMaps to
11.0.0-beta.6
.
Dependency requirements:
- Compatible version of Xcode:
14.1.0
v10.16.1
Features ✨ and improvements 🏁
- Add privacy manifest -
PrivacyInfo.xcprivacy
.
Bug fixes 🐞
- Fix
StyleColor
failing to initialize with non-sRGB color spaces by converting suppliedUIColor
s tosRGB
color space by default. - Fix incorrectly set begin timestamp for the RenderFrameFinished event.
- Cache featureState for newly added source in case it is not available in renderer.
- Allow pausing HTTP requests in the background.
- Fix line and raster layers interop for draped mode.
- Fix a crash that occurred when consecutive snapshot requests were made.
- Use the system's default fraction digit setting for currency formatting.
Dependencies
- Update MapboxCommon to
23.8.3
. - Update MapboxCoreMaps to
10.16.1
.
Dependency requirements:
- Compatible version of Xcode:
14.1.0
.
v11.0.0-beta.4
Changes
Breaking changes ⚠️
StyleColor.red
,StyleColor.green
,StyleColor.blue
,StyleColor.alpha
are not in use anymore and got removed.- The
syncSourceAndLayerIfNeeded
method in every annotation manager (e.gPointAnnotationManager
and others) was removed from the public API.
Features ✨ and improvements 🏁
- Add MSAA support with the
MapInitOptions/antialiasingSampleCount
property. StyleColor
- add support for all color formats as defined by Mapbox Style Spec.- Introduce experimental Custom Raster Source APIs:
StyleManager/addCustomRasterSource
,StyleManager/setCustomRasterSourceTileData
,StyleManager/invalidateCustomRasterSourceTile
,StyleManager/invalidateCustomRasterSourceRegion
. - Introduce new Map Content Gesture System, please refer to Map Content Gestures Guide for more information and guidance.
MapboxCoreMaps to 11.0.0-beta.5
:
Features ✨ and improvements 🏁
- Add properties to control fade out of model and fill-extrusion layers when pitch is used
- Improve fog rendering performance
- Add
getCenterAltitudeMode
function to the public API. - Improve fill layer and model layer rendering performance on high pitch views.
- Add custom raster source API to support custom raster tiles generated/provided by the client.
- Improve GPU performance by drawing opaque 3D geometry without blending
- Introduce experimental symbol-z-elevate property to elevate symbols along with the buildings that are in the same place. The feature is supported for symbols with point placement only.
- Update Mapbox Common to v24.0.0-beta.5
- Add vertical-range property for fog
Bug fixes 🐞
- Fix issue where the terrain didn't work if defined within a style fragment
- The Custom Geometry Source
fetchTileFunction()
andcancelTileFunction()
callbacks are invoked on the client thread. - Fixes a rendering error that broke symbol layers on Samsung S22 devices
- Cache featureState for newly added source in case it is not available in renderer
- Fix issue with model layer blending with geometry tile source
- Fix incorrectly set begin timestamp for the RenderFrameFinished event
Dependency requirements:
- Compatible version of Xcode:
14.1.0