Skip to content

Releases: mapbox/mapbox-maps-flutter

2.2.0-rc.1

05 Aug 10:51
0bf0f22
Compare
Choose a tag to compare
2.2.0-rc.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Expose MapboxStyles.STANDARD_SATELLITE style, by @evil159
  • MapDebugOptions is superseded by MapWidgetDebugOptions, expanding existing debug options with the new light, camera, and padding debug options in addition to the new Android-specific options: layers2DWireframe and layers3DWireframe, by @evil159

Dependency Updates

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

v2.2.0-beta.1

22 Jul 18:42
0582af7
Compare
Choose a tag to compare
v2.2.0-beta.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Support local assets for 3D puck and ModelLayer. To use a local assets, please specify it with asset:// 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

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

2.1.0

09 Jul 14:29
776f68b
Compare
Choose a tag to compare

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, and lineZOffset as experimental.
  • Add min/max/default values for most of the style properties.
  • Expose clusterMinPoints property for GeoJSONSource.
  • Expose SlotLayer and RasterParticleLayer.
  • Expose LocationComponentSettings.slot.
  • Add @experimental annotation to relevant APIs.
  • Expose LineJoin.NONE.

Dependency Updates

  • Update Mapbox Maps SDK to 11.5.0 for Android and 11.5.1 for iOS.
    • For platform-specific updates see: iOS & Android

2.1.0-rc.1

26 Jun 12:31
e688ca9
Compare
Choose a tag to compare
2.1.0-rc.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Expose text-occlusion-opacity, icon-occlusion-opacity, line-occlusion-opacity, model-front-cutoff, lineZOffset as experimental.
  • Add min/max/default values for most of the style properties.
  • Expose clusterMinPoints property for GeoJSONSource.
  • Expose SlotLayer and RasterParticleLayer.
  • Expose LocationComponentSettings.slot.
  • Add @experimental annotation to relevant APIs.

Dependency Updates

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

2.1.0-beta.1

13 Jun 12:00
d20da3b
Compare
Choose a tag to compare
2.1.0-beta.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • Add ModelLayer API.
  • Support for offline map, allowing users to download and store map data on their devices for use in environments with limited or no internet connectivity.
  • Layer expressions support. Specify expressions when constructing a layer with all new expression support for layers.

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]
  ],
);

Dependency Updates

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

2.0.0

30 May 12:16
f07098b
Compare
Choose a tag to compare

⚠️ Breaking changes

Leveraging Turf's geometries as a replacement for Map<String, Any?>

You now have the convenience of directly initializing annotations with Turf's geometries, eliminating the need for converting geometry to JSON.

Geographical position represented by Points

Geographical positions denoted by Map<String?, Object?>? are migrated to Point type from turf package.
Pass Points directly instead of converting them to JSON.
Before:

CameraOptions(
    center: Point(
        coordinates: Position(
        -0.11968,
        51.50325,
    )).toJson())

After:

CameraOptions(
    center: Point(
        coordinates: Position(
        -0.11968,
        51.50325,
    )))
Screen and geographical positions in map interaction(gestures) callbacks

MapWidget's onTapListener/onLongTapListener/onScrollListener now receive MapContentGestureContext containing both touch position of the gesture, as well as the projected map coordinate corresponding to the touch position.
Before:

onTapListener: { (coordinate)
    final lat = coordinate.x;
    final lng = coordinate.y;
    ...
}

After:

onTapListener: { (context)
    final coordinates = context.point.coordinates; // Position
    final touchPosition = context.touchPosition; // ScreenCoordinate
    ...
}
Creating an annotation with a given geometry

Before:

PointAnnotationOptions(
  geometry: Point(
    coordinates: Position(0.381457, 6.687337)
  ).toJson()
)
PolygonAnnotationOptions(
  geometry: Polygon(coordinates: [
    [
      Position(-3.363937, -10.733102),
      Position(1.754703, -19.716317),
      Position(-15.747196, -21.085074),
      Position(-3.363937, -10.733102)
    ]
  ]).toJson()
)
PolylineAnnotationOptions(
  geometry: LineString(coordinates: [
    Position(1.0, 2.0), 
    Position(10.0, 20.0)
  ]).toJson()
)

After:

PointAnnotationOptions(
  geometry: Point(
    coordinates: Position(0.381457, 6.687337)
  )
)
PolygonAnnotationOptions(
  geometry: Polygon(coordinates: [
    [
      Position(-3.363937, -10.733102),
      Position(1.754703, -19.716317),
      Position(-15.747196, -21.085074),
      Position(-3.363937, -10.733102)
    ]
  ])
)
PolylineAnnotationOptions(
  geometry: LineString(coordinates: [
    Position(1.0, 2.0), 
    Position(10.0, 20.0)
  ])
)

Features ✨ and improvements 🏁

  • [Android] Add Gradle 8 compatibility.
  • Add a way to disable default puck's image(s) when using DefaultLocationPuck2D. By passing an empty byte array, for example, the following code shows a puck 2D with custom top image, default bearing image and no shadow image.
mapboxMap?.location.updateSettings(LocationComponentSettings(
    enabled: true,
    puckBearingEnabled: true,
    locationPuck:
        LocationPuck(locationPuck2D: DefaultLocationPuck2D(topImage: list, shadowImage: Uint8List.fromList([]))))
);
  • Introduce experimental RasterArraySource, note that rasterLayers is a get-only property and cannot be set.
  • Introduce TileCacheBudget, a property to set per-source cache budgets in either megabytes or tiles.
  • Expose iconColorSaturation, rasterArrayBand, rasterElevation, rasterEmissiveStrength, hillshadeEmissiveStrength, and fillExtrusionEmissiveStrength on their respective layers.
  • Mark MapboxMapsOptions.get/setWorldview() and MapboxMapsOptions.get/setLanguage() as experimental.
Snapshots
Standalone snapshotter

Show multiple maps at the same time with no performance penalty. With the all new Snapshotter you can get image snapshots of the map, styled the same way as MapWidget.

The Snapshotter class is highly configurable. You can set the final result at the time of construction using the MapSnapshotOptions. Once you've configured your snapshot, you can start the snapshotting process.

One of the key features of the Snapshotter class is the style object. This object can be manipulated to set different styles for your snapshot, as well as to apply runtime styling to the style, giving you the flexibility to create a snapshot that fits your needs.

final snapshotter = await Snapshotter.create(
  options: MapSnapshotOptions(
      size: Size(width: 400, height: 400),
      pixelRatio: MediaQuery.of(context).devicePixelRatio),
  onStyleLoadedListener: (_) {
    // apply runtime styling
    final layer = CircleLayer(id: "circle-layer", sourceId: "poi-source");
    snapshotter?.style.addLayer(layer);
  },
);
snapshotter.style.setStyleURI(MapboxStyles.STANDARD);
snapshotter.setCamera(CameraOptions(center: Point(...)));

...

final snapshotImage = await snapshotter.start()
Map widget snapshotting

Create snapshots of the map displayed in the MapWidget with MapboxMap.snapshot(). This new feature allows you to capture a static image of the current map view.

The snapshot() method captures the current state of the Mapbox map, including all visible layers, markers, and user interactions.

To use the snapshot() method, simply call it on your Mapbox map instance. The method will return a Future that resolves to the image of the current map view.

final snapshotImage = await mapboxMap.snapshot();

Please note that the snapshot() method works best if the Mapbox Map is fully loaded before capturing an image. If the map is not fully loaded, the method might return a blank image.

Bug fixes 🐞

  • Fixes race condition in events when method call to subscribe to map events from dart side was competing with early map events.
  • [iOS] Fix crash in onStyleImageMissingListener.
  • Fix camera center not applied from map init options.
  • [iOS] Free up resources upon map widget disposal. This should help to reduce the amount of used memory when previously shown map widget is removed from the widget tree.
  • Fix multi-word enum cases decoding/encoding when being sent to/from the platform side.

Other Changes

  • Deprecate cameraForCoordinates, please use cameraForCoordinatesPadding instead.

Dependency Updates

  • Bump Mapbox Maps SDK to 11.4.0
  • Bump Pigeon to 18.0.0

v2.0.0-rc.1

16 May 15:19
75c8ad4
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

Features ✨ and improvements 🏁

  • [Android] Add Gradle 8 compatibility.
  • Fixes race condition in events when method call to subscribe to map events from dart side was competing with early map events.

Dependency Updates

  • Bump Mapbox Maps SDK to 11.4.0-rc.2

v2.0.0-beta.1

03 May 17:59
20cb112
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

2.0.0-beta.1

Features ✨ and improvements 🏁

  • Add a way to disable default puck's image(s) when using DefaultLocationPuck2D. By passing an empty byte array, for example, the following code shows a puck 2D with custom top image, default bearing image and no shadow image.
mapboxMap?.location.updateSettings(LocationComponentSettings(
    enabled: true,
    puckBearingEnabled: true,
    locationPuck:
        LocationPuck(locationPuck2D: DefaultLocationPuck2D(topImage: list, shadowImage: Uint8List.fromList([]))))
);
  • Introduce experimental RasterArraySource, note that rasterLayers is a get-only property and cannot be set.
  • Introduce TileCacheBudget, a property to set per-source cache budgets in either megabytes or tiles.
  • Expose iconColorSaturation, rasterArrayBand, rasterElevation, rasterEmissiveStrength, hillshadeEmissiveStrength, and fillExtrusionEmissiveStrength on their respective layers.
  • Mark MapboxMapsOptions.get/setWorldview() and MapboxMapsOptions.get/setLanguage() as experimental.
Snapshots
Standalone snapshotter

Show multiple maps at the same time with no performance penalty. With the all new Snapshotter you can get image snapshots of the map, styled the same way as MapWidget.

The Snapshotter class is highly configurable. You can set the final result at the time of construction using the MapSnapshotOptions. Once you've configured your snapshot, you can start the snapshotting process.

One of the key features of the Snapshotter class is the style object. This object can be manipulated to set different styles for your snapshot, as well as to apply runtime styling to the style, giving you the flexibility to create a snapshot that fits your needs.

final snapshotter = await Snapshotter.create(
  options: MapSnapshotOptions(
      size: Size(width: 400, height: 400),
      pixelRatio: MediaQuery.of(context).devicePixelRatio),
  onStyleLoadedListener: (_) {
    // apply runtime styling
    final layer = CircleLayer(id: "circle-layer", sourceId: "poi-source");
    snapshotter?.style.addLayer(layer);
  },
);
snapshotter.style.setStyleURI(MapboxStyles.STANDARD);
snapshotter.setCamera(CameraOptions(center: Point(...)));

...

final snapshotImage = await snapshotter.start()
Map widget snapshotting

Create snapshots of the map displayed in the MapWidget with MapboxMap.snapshot(). This new feature allows you to capture a static image of the current map view.

The snapshot() method captures the current state of the Mapbox map, including all visible layers, markers, and user interactions.

To use the snapshot() method, simply call it on your Mapbox map instance. The method will return a Future that resolves to the image of the current map view.

final snapshotImage = await mapboxMap.snapshot();

Please note that the snapshot() method works best if the Mapbox Map is fully loaded before capturing an image. If the map is not fully loaded, the method might return a blank image.

⚠️ Breaking changes

Leveraging Turf's geometries as a replacement for Map<String, Any?>

You now have the convenience of directly initializing annotations with Turf's geometries, eliminating the need for converting geometry to JSON.

Geographical position represented by Points

Geographical positions denoted by Map<String?, Object?>? are migrated to Point type from turf package.
Pass Points directly instead of converting them to JSON.
Before:

CameraOptions(
    center: Point(
        coordinates: Position(
        -0.11968,
        51.50325,
    )).toJson())

After:

CameraOptions(
    center: Point(
        coordinates: Position(
        -0.11968,
        51.50325,
    )))
Screen and geographical positions in map interaction(gestures) callbacks

MapWidget's onTapListener/onLongTapListener/onScrollListener now receive MapContentGestureContext containing both touch position of the gesture, as well as the projected map coordinate corresponding to the touch position.
Before:

onTapListener: { (coordinate)
    final lat = coordinate.x;
    final lng = coordinate.y;
    ...
}

After:

onTapListener: { (context)
    final coordinates = context.point.coordinates; // Position
    final touchPosition = context.touchPosition; // ScreenCoordinate
    ...
}
Creating an annotation with a given geometry

Before:

PointAnnotationOptions(
  geometry: Point(
    coordinates: Position(0.381457, 6.687337)
  ).toJson()
)
PolygonAnnotationOptions(
  geometry: Polygon(coordinates: [
    [
      Position(-3.363937, -10.733102),
      Position(1.754703, -19.716317),
      Position(-15.747196, -21.085074),
      Position(-3.363937, -10.733102)
    ]
  ]).toJson()
)
PolylineAnnotationOptions(
  geometry: LineString(coordinates: [
    Position(1.0, 2.0), 
    Position(10.0, 20.0)
  ]).toJson()
)

After:

PointAnnotationOptions(
  geometry: Point(
    coordinates: Position(0.381457, 6.687337)
  )
)
PolygonAnnotationOptions(
  geometry: Polygon(coordinates: [
    [
      Position(-3.363937, -10.733102),
      Position(1.754703, -19.716317),
      Position(-15.747196, -21.085074),
      Position(-3.363937, -10.733102)
    ]
  ])
)
PolylineAnnotationOptions(
  geometry: LineString(coordinates: [
    Position(1.0, 2.0), 
    Position(10.0, 20.0)
  ])
)

Bug fixes 🐞

  • [iOS] Fix crash in onStyleImageMissingListener.
  • Fix camera center not applied from map init options.
  • [iOS] Free up resources upon map widget disposal. This should help to reduce the amount of used memory when previously shown map widget is removed from the widget tree.
  • Fix multi-word enum cases decoding/encoding when being sent to/from the platform side.

Other Changes

  • Deprecate cameraForCoordinates, please use cameraForCoordinatesPadding instead.

Dependency Updates

  • Bump Mapbox Maps SDK to 11.4.0-beta.2
  • Bump Pigeon to 17.1.2

0.6.0

26 Apr 11:30
902d0c8
Compare
Choose a tag to compare

Note

This release contains fixes to the Privacy Manifest on iOS. Upgrade to avoid issues in the App Store app submission starting from May 1st.

Android

  • Fix map being pixelated on some devices when ContextMode.SHARED is used (e.g. in AndroidAuto extension).
  • Fix incorrect widget position and scale when resizing the drawing surface.
  • Fix a crash in MapView.snapshot happening on specific devices.

iOS

  • Fix the issue with invalid privacy manifest

1.1.0

12 Apr 14:55
97c86d1
Compare
Choose a tag to compare
  • [Android] Fix maps-lifecycle plugin crash with java.lang.IllegalStateException: Please ensure that the hosting activity/fragment is a valid LifecycleOwner.
  • [Android] Fix hasStyleImage() method hanging.
  • [Android] Fix getStyleImage() method causing native exception.
  • [iOS] Fix crash in onStyleImageMissingListener.
  • Update MapboxMaps version to 11.3.0
    • For platform-specific updates see: iOS & Android