mapbox / mapbox/mapbox-maps-flutter

Black screen when using MapboxMap widget

Open
#913 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

When I try to display a Mapbox map using the MapWidget from mapbox_maps_flutter, it shows only a black screen. I followed the installation steps correctly.

Platform:
- [ ] Android
- [x] iOS

Flutter version: 3.27.1
Mapbox plugin version: 2.7.0
Device: iPhone 16
OS Version: iOS 18.4

Code Snippet:
```dart
class _SearchMapState extends NyState {
MapboxMap? mapboxMap;

// MapBox camera setttings
CameraOptions camera = CameraOptions(
center: Point(
coordinates: Position(
44.82813153527211,
41.683475464916256,
)),
zoom: 10,
bearing: 0,
pitch: 0,
);

_onMapCreated(MapboxMap mapboxMap) async {
this.mapboxMap = mapboxMap;

await mapboxMap.location
.updateSettings(LocationComponentSettings(enabled: true));
}

_SearchMapState() {
stateName = SearchMap.state;
}

@override
get init => () async {
};

@override
Widget view(BuildContext context) {
return MapWidget(
cameraOptions: camera,
onMapCreated: _onMapCreated,
);
}
}
```

Screenshot:
Issue Screenshot

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the black screen on iOS with Flutter 3.27.1, mapbox_maps_flutter 2.7.0, an iPhone 16, and iOS 18.4 using the supplied MapWidget snippet. Inspect the MapWidget and _onMapCreated path, then verify that the map renders instead of remaining black; no test file or source path is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.