Releases: mapbox/mapbox-maps-flutter
2.4.0-rc.1
Features ✨ and improvements 🏁
- Updated the minimum required Flutter SDK to version 3.22.3 and Dart to version 3.4.4. With the fix for Virtual Display hosting mode on Android in Flutter 3.22, we’ve changed the default map view hosting mode to Virtual Display composition. This update should eliminate the brief visibility of the map after it has been dismissed. #754
- Introduce experimental property
MapboxMap.styleGlyphURL
. Use this property to apply custom fonts to the map at runtime, without modifying the base style. #753
Dependency Updates
2.4.0-beta.1
Features ✨ and improvements 🏁
- Expose current map's camera state on
CameraChanged
event. #704
You can now observe the map's camera updates with onCameraChangeListener
onCameraChangeListener(CameraChangedEventData data) {
print("CameraChangedEventData: timestamp: ${data.timestamp}, cameraState: ${data.cameraState}");
}
- Print to console native Maps SDK logs in debug configuration. Logs are proxied only in debug configuration and can be disabled completely by passing environment flag
MAPBOX_LOG_DEBUG
with false value. #710 - Remove
ProxyBinaryMessenger
, instead setup channel with amessageChannelSuffix
. #715.
Bug fixes 🐞
- Fix rare crash in
Snapshotter
. The crash could happen when creating/destroying multiple instances ofSnapshotter
in succession. #728 - Fix a crash that occurs when the widget state is updated before the platform view is created. #724
- Fix a crash in Snapshotter when GlyphsRasterizationMode is specified in MapSnapshotOptions. #738
Dependency Updates
2.3.0
Features ✨ and improvements 🏁
- Deprecate untyped default constructor of
RenderedQueryGeometry
with typed constructors:RenderedQueryGeometry.fromList()/fromScreenBox()/fromScreenCoordinate()
.
This change improves type safety and clarity in the code. By using specific constructors, you can ensure that the RenderedQueryGeometry
is created with the correct type of data, reducing the risk of runtime errors and making the code easier to understand and maintain.
Example:
Before:
// Using the untyped default constructor
final geometry = RenderedQueryGeometry(type: Type.SCREEN_COORDINATE, value jsonEncode(screenCoordinate.encode()));
After:
// Using a typed constructor
final geometry = RenderedQueryGeometry.fromScreenCoordinate(screenCoordinate);
- Expose API to clear map data, and to set options to
TileStore
.
You can now clear temporary map data from the data path defined in the given resource options, which is useful when you want reduce the disk usage or in case the disk cache contains invalid data.
await MapboxMapsOptions.clearData();
And you can now set additional options to a TileStore
, for example, a maximum amount of bytes TileStore can use to store files., base URL to use for requests to the Mapbox API, or URL template for making tile requests.
// Set the disk quota to zero, so that tile regions are fully evicted
// when removed.
// This removes the tiles from the predictive cache.
tileStore.setDiskQuota(0);
- Add support for partial GeoJSON updates.
Instead of setting a whole new GeoJSON object anew every time a single feature has changed, now you can apply more granular, partial GeoJSON updates.
If your features have associated identifiers - you can add, update, and remove them on individual basis in your GeoJSONSource
. This is especially beneficial for GeoJSONSource
s hosting a large amount of features - in this case adding a feature can be up to 4x faster with the partial GeoJSON update API.
mapboxMap.style.addGeoJSONSourceFeatures(sourceId, dataId, features)
mapboxMap.style.updateGeoJSONSourceFeatures(sourceId, dataId, features)
mapboxMap.style.removeGeoJSONSourceFeatures(sourceId, dataId, featureIds)
- Expose data-driven properties on annotation managers. Now it's possible to set data-driven properties globally on annotation manager and specify per-annotation overrides.
Previously user had to specify those properties on each annotation and couldn't specify them globally.
In this case each even annotation will have random color, but others will use the global default specified in the annotation manager.
final circleAnnotationManager = await mapboxMap.annotations.createCircleAnnotationManager();
var annotations = <CircleAnnotationOptions>[];
for (var i = 0; i < 2000; i++){
var annotation = CircleAnnotationOptions(
geometry: createRandomPoint(),
circleColor: (i % 2 == 0) ? createRandomColor() : null,
);
annotations.add(annotation);
}
circleAnnotationManager.setCircleColor(Colors.blue.value);
- Expose
autoMaxZoom
property forGeoJsonSource
to fix rendering issues withFillExtrusionLayer
in some cases. - Expose experimental
ClipLayer
to remove 3D data (fill extrusions, landmarks, trees) and symbols. - Deprecate
SlotLayer.sourceId
andSlotLayer.sourceLayer
as they have no effect in this layer. - Expose experimental
SymbolLayer.symbolElevationReference
andSymbolLayer.symbolZOffset
. - Add missing
@experimental
annotations toLayer
'sExpression
properties. - Remove experimental
modelFrontCutoff
property fromModelLayer
. - Expose experimental
lineTrimColor
andlineTrimFadeRange
onLineLayer
which allow to set custom color for trimmed line and fade effect for trim. - Add experimental
FillExtrusionLayer.fillExtrusionLineWidth
that can switch fill extrusion rendering into wall rendering mode. Use this property to render the feature with the given width over the outlines of the geometry. - Add experimental
MapboxMap.setSnapshotLegacyMode()
to help avoidingMapboxMap.snapshot()
native crash on some Samsung devices running Android 14.MapboxMap.setSnapshotLegacyMode()
has no effect on iOS. - Add
GestureState
toMapContentGestureContext
to indicate whether gesture has been started, its touches have changed or it has ended.
Bug fixes 🐞
- Fix
StyleManager.getLayer()
failing forModelLayer
,RasterParticleLayer
andSlotLayer
. - Fix build errors when using Flutter SDK 3.24.
Dependency Updates
2.3.0-rc.1
Features ✨ and improvements 🏁
- Expose API to clear map data, and to set options to
TileStore
.
You can now clear temporary map data from the data path defined in the given resource options, which is useful when you want reduce the disk usage or in case the disk cache contains invalid data.
await MapboxMapsOptions.clearData();
And, you can now set additional options to a TileStore
. For example, you can set a maximum amount of bytes TileStore can use to store files, a base URL to use for requests to the Mapbox API, or a URL template for making tile requests.
// Set the disk quota to zero, so that tile regions are fully evicted
// when removed.
// This removes the tiles from the predictive cache.
tileStore.setDiskQuota(0);
- Add support for partial GeoJSON updates.
Instead of setting a whole new GeoJSON object anew every time a single feature has changed, now you can apply more granular, partial GeoJSON updates.
If your features have associated identifiers - you can add, update, and remove them on individual basis in your GeoJSONSource
. This is especially beneficial for GeoJSONSource
s hosting a large amount of features - in this case adding a feature can be up to 4x faster with the partial GeoJSON update API.
mapboxMap.style.addGeoJSONSourceFeatures(sourceId, dataId, features)
mapboxMap.style.updateGeoJSONSourceFeatures(sourceId, dataId, features)
mapboxMap.style.removeGeoJSONSourceFeatures(sourceId, dataId, featureIds)
- Expose data-driven properties on annotation managers. Now it's possible to set data-driven properties globally on annotation manager and specify per-annotation overrides.
Previously user had to specify those properties on each annotation and couldn't specify them globally.
In this case each even annotation will have random color, but others will use the global default specified in the annotation manager.
final circleAnnotationManager = await mapboxMap.annotations.createCircleAnnotationManager();
var annotations = <CircleAnnotationOptions>[];
for (var i = 0; i < 2000; i++){
var annotation = CircleAnnotationOptions(
geometry: createRandomPoint(),
circleColor: (i % 2 == 0) ? createRandomColor() : null,
);
annotations.add(annotation);
}
circleAnnotationManager.setCircleColor(Colors.blue.value);
- Expose
autoMaxZoom
property forGeoJsonSource
to fix rendering issues withFillExtrusionLayer
in some cases. - Expose experimental
ClipLayer
to remove 3D data (fill extrusions, landmarks, trees) and symbols. - Deprecate
SlotLayer.sourceId
andSlotLayer.sourceLayer
as they have no effect in this layer. - Expose experimental
SymbolLayer.symbolElevationReference
andSymbolLayer.symbolZOffset
. - Add missing
@experimental
annotations toLayer
'sExpression
properties. - Remove experimental
model-front-cutoff
property fromModelLayer
. - Expose experimental
lineTrimColor
andlineTrimFadeRange
onLineLayer
which allow to set custom color for trimmed line and fade effect for trim. - Add experimental
FillExtrusionLayer.fillExtrusionLineWidth
that can switch fill extrusion rendering into wall rendering mode. Use this property to render the feature with the given width over the outlines of the geometry. - Add experimental
MapboxMap.setSnapshotLegacyMode()
to help avoidingMapboxMap.snapshot()
native crash on some Samsung devices running Android 14.MapboxMap.setSnapshotLegacyMode()
has no effect on iOS.
Bug fixes 🐞
- Fix
StyleManager.getLayer()
failing forModelLayer
,RasterParticleLayer
andSlotLayer
.
Dependency Updates
2.3.0-beta.1
Features ✨ and improvements 🏁
- Add
GestureState
toMapContentGestureContext
to indicate whether gesture has been started, its touches have changed or it has ended.
Bug fixes 🐞
- Fix build errors when using Flutter SDK 3.24.
Dependency Updates
v2.2.1
v2.2.0
Features ✨ and improvements 🏁
- Expose
MapboxStyles.STANDARD_SATELLITE
style, by @evil159. Please read more about this here MapDebugOptions
is superseded byMapWidgetDebugOptions
, expanding existing debug options with the newlight
,camera
, andpadding
debug options in addition to the new Android-specific options:layers2DWireframe
andlayers3DWireframe
, by @evil159- Support local assets for 3D puck and
ModelLayer
. To use a local assets, please specify it withasset://
scheme followed by the path of the asset in the uri, by @maios
mapboxMap.location.updateSettings(LocationComponentSettings(
locationPuck: LocationPuck(
locationPuck3D: LocationPuck3D(
modelUri: "asset://assets/sportcar.glb",
modelScale: [_puckScale, _puckScale, _puckScale]))));
- Fix map view crashing upon host activity destruction when using a cached Flutter engine, by @evil159
- Fix a rare crash happening when map widget is being disposed, by @evil159
- Update Pigeon to 21.1.0
Dependency Updates
2.2.0-rc.1
Features ✨ and improvements 🏁
- Expose
MapboxStyles.STANDARD_SATELLITE
style, by @evil159 MapDebugOptions
is superseded byMapWidgetDebugOptions
, expanding existing debug options with the newlight
,camera
, andpadding
debug options in addition to the new Android-specific options:layers2DWireframe
andlayers3DWireframe
, by @evil159
Dependency Updates
v2.2.0-beta.1
Features ✨ and improvements 🏁
- Support local assets for 3D puck and
ModelLayer
. To use a local assets, please specify it withasset://
scheme followed by the path of the asset in the uri, by @maios
mapboxMap.location.updateSettings(LocationComponentSettings(
locationPuck: LocationPuck(
locationPuck3D: LocationPuck3D(
modelUri: "asset://assets/sportcar.glb",
modelScale: [_puckScale, _puckScale, _puckScale]))));
- Fix map view crashing upon host activity destruction when using a cached Flutter engine, by @evil159
- Fix a rare crash happening when map widget is being disposed, by @evil159
Dependency Updates
2.1.0
Features ✨ and improvements 🏁
- Add ModelLayer API.
- Add support for offline maps, allowing users to download and store map data on their devices for use in environments with limited or no internet connectivity.
- Add layer expressions support. To use, specify expressions when constructing a layer.
Before:
mapboxMap.style.setStyleLayerProperty("layer", "line-gradient",
'["interpolate",["linear"],["line-progress"],0.0,["rgb",255,0,0],0.4,["rgb",0,255,0],1.0,["rgb",0,0,255]]');
After:
LineLayer(
...
lineGradientExpression: [
"interpolate",
["linear"],
["line-progress"],
0.0,
["rgb", 255, 0, 0],
0.4,
["rgb", 0, 255, 0],
1.0,
["rgb", 0, 0, 255]
],
);
- Expose
text-occlusion-opacity
,icon-occlusion-opacity
,line-occlusion-opacity
,model-front-cutoff
, andlineZOffset
as experimental. - Add min/max/default values for most of the style properties.
- Expose
clusterMinPoints
property forGeoJSONSource
. - Expose
SlotLayer
andRasterParticleLayer
. - Expose
LocationComponentSettings.slot
. - Add
@experimental
annotation to relevant APIs. - Expose
LineJoin.NONE
.