Repository navigation
v3.0.0-rc.1
Pre-release
Pre-release
Important
For full migration guide, check MIGRATION.md
What's new ✨
All platforms
- Split the plugin into federated packages:
mapbox_maps_flutter(public facade),mapbox_maps_flutter_platform_interface,mapbox_maps_flutter_mobile, andmapbox_maps_flutter_web. Addmapbox_maps_flutteras the app-facing dependency; mobile and web packages are endorsed automatically. - Introduce
StyleImage(.bytesfor PNG/JPEG/WebP,.rgbafor premultiplied pixels) and prefer it viaaddImage,updateImageForSource, andgetImage. Deprecate theMbxImage-basedaddStyleImage,updateStyleImageSourceImage, andgetStyleImagewrappers. Style image add/has/remove is implemented on web;getImageand image-source updates remain mobile-only for now. RenderedQueryGeometryis now a sealed class hierarchy (ScreenCoordinateRenderedQueryGeometry,ScreenBoxRenderedQueryGeometry,ScreenCoordinateListRenderedQueryGeometry) instead of an untyped{value, type}pair. Construct it the same way as before, viafromScreenCoordinate()/fromScreenBox()/fromList(). Use pattern matching on the subclasses to inspect it instead of the now-deprecated, read-onlyvalue/typeaccessors.
Web
- Web is now supported.
MapWidget,MapboxMap, gestures, camera, the viewport API (Camera, FollowPuck, Idle, Overview, StyleDefault states, with Default/Easing/Fly transitions), and the location puck all work. The Interaction API is supported except forLongTapInteraction. Annotation managers (Circle, Point, Polyline, Polygon) are not yet implemented. - Add ornament settings support:
compass,scaleBar,logoandattributionare backed by the Mapbox GL JS controls and support partial updates, matching Android and iOS. Some fields have no GL JS counterpart and are stored and returned bygetSettingswithout being applied; see each field's documentation. NoteLogoSettings.enabledandAttributionSettings.enabledare a restricted API. - Add
MapboxMap.snapshot()support. It captures the map's current canvas as PNG-encoded bytes, matching Android and iOS. - Add
loadStyleJsonsupport. - Add
gestures.keyboard.gestureEvents, delivering keyboard-driven camera changes (arrow keys,+/-, shift+arrows), and make keyboard input follow the same gesture settings as pointer/touch input:GesturesSettings.scrollEnabledgates arrow-key pan, and.rotateEnabled/.pitchEnabledindependently gate Shift+arrow rotate and pitch. - Add
GesturesSettings.scrollZoomEnabled,.boxZoomEnabled, and.pitchWithRotateEnabledto control mouse-wheel/trackpad zoom, box zoom, and whether ctrl+drag combines rotate with pitch (web only; no effect on Android/iOS). GesturesSettings.quickZoomEnabledcontrols tap-and-drag zoom.- Flutter widgets stacked over the map block clicks/taps, scroll-zoom, and cursor styling from reaching Mapbox GL JS underneath, matching how a widget stacked over a native view would behave.
MapWidget.styleUriloads the requested style directly, without first loading a default style.- Document how web keeps a GeoJSON feature id. GL JS keeps the id only if it is a number, or a string that holds a number. It removes all other string ids, and the feature then has no id on web. Use a number for these ids, or put the id in a feature property.
- Add
GeoJsonSource.dynamicData, mapping to thedynamicoption in the style specification. Set it to true for the source to acceptaddGeoJSONSourceFeatures,updateGeoJSONSourceFeatures, andremoveGeoJSONSourceFeatures. No-op on Android and iOS, which accept feature updates on all GeoJSON sources regardless. - Decode
rgb,hsl, andhslastyle-color expressions correctly.rgbaexpressions were already decoded correctly. gl-native (Android/iOS) folds these intorgbabefore Flutter reads them back, so mobile is not affected either way.
Android
- Change the default platform-view hosting mode to Hybrid Composition (
AndroidPlatformViewHostingMode.HC); it was previously Virtual Display. SetMapWidget.androidHostingModeexplicitly to keep the old behaviour. - Render the map into a
SurfaceViewby default instead of aTextureView, avoiding the per-frame copy aTextureViewrequires. SetMapWidget.textureViewtotruefor a transparent background (isOpaque: false) and for theVDandTLHC_VDhosting modes, which cannot display aSurfaceView.
Bug fixes 🐞
iOS & Android
- Fix
PointAnnotationManager.update()not applying a newimagewhen the annotation'siconImagestill named a previous registration (#532). If you leaveiconImageunset, the SDK derives one from a hash ofimage, so a content change now applies automatically. SeticonImageyourself for full control of the style-image name: for example, to reuse one name across annotations, or to point at a style image added elsewhere without uploadingimage.
iOS
getStyleImage(and the deprecatedgetStyleImage/getImagewrappers built on it) now return raw premultiplied RGBA pixel data instead of a PNG-encoded image, matching Android's existing behavior. Code that decoded the returneddataas PNG must decode it as raw RGBA instead.
Breaking changes ⚠️
All platforms
- Remove APIs deprecated in v2:
MapWidget.cameraOptions(useviewport),MapWidget.getMapboxMap()(useonMapCreated),MapboxMap.setCustomHeadersandMapboxHttpService.setCustomHeaders(usesetCustomHeadersForHost),PointAnnotation.iconImageCrossFade/PointAnnotationOptions.iconImageCrossFade(usePointAnnotationManager.iconImageCrossFade), and theOnMapTapListener/OnMapLongTapListenertypedefs (use the Interaction API). tileCoverandSnapshotter.tileCoverare marked experimental and now returnOverscaledTileIDinstead ofCanonicalTileID, matching the native SDKs.OverscaledTileIDkeeps the canonical tile coordinate in itscanonicalfield, and addsoverscaledZandwrapso callers can distinguish overscaled tiles from their canonical zoom level, and tiles that repeat across the antimeridian.
Platform API coverage
Web support is actively being developed. Not all APIs available on iOS and Android are supported on web yet — full parity is coming in future releases. APIs that are not available on a given platform will throw UnimplementedError at runtime.