10.1 C
Canberra
Tuesday, July 22, 2025

ios – Flutter MapBox maps are simply black


I am making an attempt to make a web page utilizing a MapWidget from mapbox_maps_flutter model ^2.8.0-beta. Nonetheless, the map does not load and is simply black. No errors have been outputted.

My code labored a pair days in the past, and solely yesterday this began. All earlier implementations of MapBox MapWidget are simply black. The annotations on them nonetheless work via. I initially had my customized styleURI, however even after eradicating it or altering it, there have been no results.

I attempted going again to model 2.7.0, however no change. I attempted creating new MapBox account, regenerate entry code, producing personal entry code, checking public permissions, however none labored.

I’ve made certain that setAccessCode is in my primary(). I discovered that if I eliminated that line, nothing would change. I believe MapBox shouldn’t be detecting this then.

primary.dart

void primary() async {
  WidgetsFlutterBinding.ensureInitialized();

  MapboxOptions.setAccessToken(
    'VALID_TOKEN',
  );

One in all my map implementations. All of them do not work, however they used to

void onMapCreated(MapboxMap mapboxMap) async {
    _mapboxMap = mapboxMap;

    await _mapboxMap!.brand.updateSettings(LogoSettings(enabled: false));
    await _mapboxMap!.attribution.updateSettings(
      AttributionSettings(enabled: false),
    );
    await _mapboxMap!.scaleBar.updateSettings(ScaleBarSettings(enabled: false));

    await _mapboxMap!.location.updateSettings(
      LocationComponentSettings(
        enabled: true,
        pulsingEnabled: true,
        puckBearingEnabled: true,
        locationPuck: LocationPuck(
          locationPuck3D: LocationPuck3D(
            modelUri:
                'https://uncooked.githubusercontent.com/KhronosGroup/glTF-Pattern-Fashions/grasp/2.0/Duck/glTF-Embedded/Duck.gltf',
            modelScale: [30.0, 30.0, 30.0],
          ),
        ),
      ),
    );

    strive {
      ultimate geo.Place pos = await _determinePosition();
      await _mapboxMap!.setCamera(
        CameraOptions(
          heart: Level(coordinates: Place(pos.longitude, pos.latitude)),
          zoom: 1.0,
          bearing: pos.heading,
        ),
      );
    } catch (e) {
      debugPrint('Error getting person location: $e');
    }

    geo.Geolocator.getPositionStream(
      locationSettings: const geo.LocationSettings(
        accuracy: geo.LocationAccuracy.excessive,
        distanceFilter: 10,
      ),
    ).pay attention((place) async {
      if (!_isUserInteracting && _mapboxMap != null) {
        await _mapboxMap!.flyTo(
          CameraOptions(
            heart: Level(
              coordinates: Place(place.longitude, place.latitude),
            ),
            bearing: place.heading,
          ),
          MapAnimationOptions(period: 500),
        );
      }
    });

    _circleAnnotationManager =
        await _mapboxMap!.annotations.createCircleAnnotationManager();
    _circleAnnotationManager!.addOnCircleAnnotationClickListener(
      _annotationClickListener,
    );
    _mapLoaded = true;
    _addSightingsToMap();
}

MapWidget(
    styleUri: 'some public fashion',
    onMapCreated: onMapCreated,
),

I’ve additionally executed flutter clear, pod reinstall, however do not work.

There aren’t any on-line options besides one: https://github.com/mapbox/mapbox-maps-flutter/points/333. However even after downgrading SDK, nothing modifications.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles