Note
There is a known crash when calling TileStore.createAt on Android. This will be addressed in v2.24.0-rc.1.
Deprecations ⚠️
- Deprecate
MapWidget.cameraOptionsin favor of theviewportAPI — existing usage still works but will be removed in next major version; migrate camera initialization and updates to theviewportAPI.
// Before
MapWidget(
cameraOptions: CameraOptions(
center: Point(coordinates: Position(-117.918976, 33.812092)),
zoom: 15.0,
),
);
// After
MapWidget(
viewport: CameraViewportState(
center: Point(coordinates: Position(-117.918976, 33.812092)),
zoom: 15.0,
),
);- Deprecate
MapWidget.onTapListenerandMapWidget.onLongTapListenerin favor of theMapboxMap.addInteractionAPI — tap/long-tap handlers will be removed in next major version; migrate to the Interactions API for richer feature-aware handling.
Other gesture listeners (scroll, zoom, etc.) are unaffected.
// Before
MapWidget(
onTapListener: (context) {
print('Tapped at ${context.point}');
},
onLongTapListener: (context) {
print('Long-tapped at ${context.point}');
},
);
// After — on the map itself
mapboxMap.addInteraction(TapInteraction.onMap((context) {
print('Tapped at ${context.point}');
}));
mapboxMap.addInteraction(LongTapInteraction.onMap((context) {
print('Long-tapped at ${context.point}');
}));