Skip to content

Releases: mapbox/mapbox-maps-flutter

2.5.0

19 Dec 12:43
fec76ec
Compare
Choose a tag to compare

Features ✨ and improvements 🏁

  • Added viewport support to MapWidget. Control the camera’s initial position and behavior by specifying a ViewportState subclass in the viewport parameter. This allows for centering on specific locations, following the user’s position, or showing an overview of a geometry. If no viewport is provided, the map uses its default camera settings.
    MapWidget(
      viewport: CameraViewportState(
        center: Point(coordinates: Position(-117.918976, 33.812092)),
        zoom: 15.0,
      ),
    );
  • Marked ClipLayer as stable.
  • Updated our generated code to align with iOS and Android platforms. Specifically, the changes:
    • Updated experimental symbolElevationReference property on SymbolLayer.
    • Introduced backgroundPitchAlignment property on BackgroundLayer.
    • Introduced experimental fillZOffset property on FillLayer.
    • Introduced experimental fillExtrusionBaseAlignment and fillExtrusionHeightAlignment properties on FillExtrusionLayer.
    • Marked get and set ZOffset methods on PolygonAnnotationManager, PolylineAnnotationManager, and PointAnnotationManager as experimental.
    • Marked get and set symbolElevationReference methods on PointAnnotationManager as experimental.
    • Marked get and set line trim methods on PolylineAnnotationManager as experimental.
    • Added a property emphasisCircleGlowRange to LocationIndicatorLayer to control the glow effect of the emphasis circle – from the solid start to the fully transparent end.
    • Added experimental ZOffset properties to PolylineAnnotationMessenger, PolygonAnnotationMessenger, and PointAnnotationMessenger.
    • Introduced FillExtrusionBaseAlignment and FillExtrusionHeightAlignment, and BackgroundPitchAlignment enums.

Dependency Updates

  • Updated Mapbox Maps SDK to 11.9.0
    • For platform-specific updates see: iOS & Android

2.5.0-rc.1

11 Dec 15:19
d887f9e
Compare
Choose a tag to compare
2.5.0-rc.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

Updated our generated code to align with iOS and Android platforms. Specifically, the changes:

  • Update experimental symbolElevationReference property on SymbolLayer.
  • Introduce backgroundPitchAlignment property on BackgroundLayer.
  • Introduce experimental fillZOffset property on FillLayer.
  • Introduce experimental fillExtrusionBaseAlignment and fillExtrusionHeightAlignment properties on FillExtrusionLayer.
  • Mark get and set ZOffset methods on PolygonAnnotationManager, PolylineAnnotationManager, and PointAnnotationManager as experimental.
  • Mark get and set symbolElevationReference methods on PointAnnotationManager as experimental.
  • Mark get and set line trim methods on PolylineAnnotationManager as experimental.
  • Add a property emphasisCircleGlowRange to LocationIndicatorLayer to control the glow effect of the emphasis circle – from the solid start to the fully transparent end.
  • Add experimental ZOffset properties to PolylineAnnotationMessenger, PolygonAnnotationMessenger, and PointAnnotationMessenger.
  • Introduce FillExtrusionBaseAlignment and FillExtrusionHeightAlignment, and BackgroundPitchAlignment enums.

Dependency Updates

  • Update Mapbox Maps SDK to 11.9.0-rc.1
    • For platform-specific updates see: iOS & Android

2.5.0-beta.1

04 Dec 17:37
146b113
Compare
Choose a tag to compare
2.5.0-beta.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Added viewport support to MapWidget. Control the camera’s initial position and behavior by specifying a ViewportState subclass in the viewport parameter. This allows for centering on specific locations, following the user’s position, or showing an overview of a geometry. If no viewport is provided, the map uses its default camera settings. PR by @evil159
MapWidget(
  viewport: CameraViewportState(
    center: Point(coordinates: Position(-117.918976, 33.812092)),
    zoom: 15.0,
  ),
);
  • Update Turf dependency to 4.0.0-beta.1

Dependency Updates

  • Update Mapbox Maps SDK to 11.9.0-beta.1
    • For platform-specific updates see: iOS & Android

2.4.1

18 Nov 16:21
a1a98f6
Compare
Choose a tag to compare

Bug fixes 🐞

  • Fix annotation click listeners not working. #777

2.4.0

12 Nov 14:05
be63fee
Compare
Choose a tag to compare

Important

Configuring Mapbox's secret token is no longer required when installing our SDKs.

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

  • 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 a messageChannelSuffix. #715.

Bug fixes 🐞

  • Fix rare crash in Snapshotter. The crash could happen when creating/destroying multiple instances of Snapshotter 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.4.0-rc.1

31 Oct 16:40
8eebddb
Compare
Choose a tag to compare
2.4.0-rc.1 Pre-release
Pre-release

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

  • Update Mapbox Maps SDK to 11.8.0-rc.1
    • For platform-specific updates see: iOS & Android

2.4.0-beta.1

18 Oct 14:03
825e8fa
Compare
Choose a tag to compare
2.4.0-beta.1 Pre-release
Pre-release

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 a messageChannelSuffix. #715.

Bug fixes 🐞

  • Fix rare crash in Snapshotter. The crash could happen when creating/destroying multiple instances of Snapshotter 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

  • Update Mapbox Maps SDK to 11.8.0-beta.1
    • For platform-specific updates see: iOS & Android

2.3.0

02 Oct 07:47
0a5b625
Compare
Choose a tag to compare

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 GeoJSONSources 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 for GeoJsonSource to fix rendering issues with FillExtrusionLayer in some cases.
  • Expose experimental ClipLayer to remove 3D data (fill extrusions, landmarks, trees) and symbols.
  • Deprecate SlotLayer.sourceId and SlotLayer.sourceLayer as they have no effect in this layer.
  • Expose experimental SymbolLayer.symbolElevationReference and SymbolLayer.symbolZOffset.
  • Add missing @experimental annotations to Layer's Expression properties.
  • Remove experimental modelFrontCutoff property from ModelLayer.
  • Expose experimental lineTrimColor and lineTrimFadeRange on LineLayer 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 avoiding MapboxMap.snapshot() native crash on some Samsung devices running Android 14. MapboxMap.setSnapshotLegacyMode() has no effect on iOS.
  • Add GestureState to MapContentGestureContext to indicate whether gesture has been started, its touches have changed or it has ended.

Bug fixes 🐞

  • Fix StyleManager.getLayer() failing for ModelLayer, RasterParticleLayer and SlotLayer.
  • Fix build errors when using Flutter SDK 3.24.

Dependency Updates

  • Update Mapbox Maps SDK to 11.7.0
    • For platform-specific updates see: iOS & Android

2.3.0-rc.1

19 Sep 13:22
1ce5151
Compare
Choose a tag to compare
2.3.0-rc.1 Pre-release
Pre-release

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 GeoJSONSources 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 for GeoJsonSource to fix rendering issues with FillExtrusionLayer in some cases.
  • Expose experimental ClipLayer to remove 3D data (fill extrusions, landmarks, trees) and symbols.
  • Deprecate SlotLayer.sourceId and SlotLayer.sourceLayer as they have no effect in this layer.
  • Expose experimental SymbolLayer.symbolElevationReference and SymbolLayer.symbolZOffset.
  • Add missing @experimental annotations to Layer's Expression properties.
  • Remove experimental model-front-cutoff property from ModelLayer.
  • Expose experimental lineTrimColor and lineTrimFadeRange on LineLayer 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 avoiding MapboxMap.snapshot() native crash on some Samsung devices running Android 14. MapboxMap.setSnapshotLegacyMode() has no effect on iOS.

Bug fixes 🐞

  • Fix StyleManager.getLayer() failing for ModelLayer, RasterParticleLayer and SlotLayer.

Dependency Updates

  • Update Mapbox Maps SDK to 11.7.0-rc.1
    • For platform-specific updates see: iOS & Android

2.3.0-beta.1

06 Sep 11:58
3ce880a
Compare
Choose a tag to compare
2.3.0-beta.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Add GestureState to MapContentGestureContext 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

  • Update Mapbox Maps SDK to 11.7.0-beta.1
    • For platform-specific updates see: iOS & Android