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 would 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 by means of. 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 major(). I discovered that if I eliminated that line, nothing would change. I feel MapBox shouldn’t be detecting this then.
major.dart
void major() 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],
),
),
),
);
attempt {
last geo.Place pos = await _determinePosition();
await _mapboxMap!.setCamera(
CameraOptions(
middle: 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,
),
).hear((place) async {
if (!_isUserInteracting && _mapboxMap != null) {
await _mapboxMap!.flyTo(
CameraOptions(
middle: 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 completed 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 adjustments.