Skip to content

Black screen when using MapboxMap widget #913

Open
@B3K4682

Description

@B3K4682

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
  • iOS

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

Code Snippet:

class _SearchMapState extends NyState<SearchMap> {
  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions