eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
211 stars 175 forks source link

black screen on ios simulator #323

Closed samderlust closed 10 months ago

samderlust commented 10 months ago

I got black screen while try to use the mapbox navigation

 MapBoxNavigationView(
            options: MapBoxOptions(
              initialLatitude: 36.1175275,
              initialLongitude: -115.1839524,
              zoom: 13.0,
              tilt: 0.0,
              bearing: 0.0,
              enableRefresh: false,
              alternatives: true,
              voiceInstructionsEnabled: true,
              bannerInstructionsEnabled: true,
              allowsUTurnAtWayPoints: true,
              mode: MapBoxNavigationMode.drivingWithTraffic,
              mapStyleUrlDay: "mapbox://styles/mapbox/light-v11",
              // mapStyleUrlNight: "mapbox://styles/mapbox/dark-v11",
              units: VoiceUnits.imperial,
              simulateRoute: true,
              language: "en",
            ),
            onRouteEvent: (event) {
              debugPrint("EVENT ${event.eventType}");
            },
            onCreated: (controller) async {
              mapCtrl.value = controller;
              await mapCtrl.value?.initialize();
              // controller.buildRoute(wayPoints: wayPoints);
            },
          ),

simulator_screenshot_A25DBC62-65B4-4BBC-8A51-356F18C9E770

eopeter commented 10 months ago

Need to follow instruction on how to supply your access tokensOn Nov 1, 2023, at 5:15 PM, Sáng Nguyen @.***> wrote: I got black screen while try to use the mapbox navigation MapBoxNavigationView( options: MapBoxOptions( initialLatitude: 36.1175275, initialLongitude: -115.1839524, zoom: 13.0, tilt: 0.0, bearing: 0.0, enableRefresh: false, alternatives: true, voiceInstructionsEnabled: true, bannerInstructionsEnabled: true, allowsUTurnAtWayPoints: true, mode: MapBoxNavigationMode.drivingWithTraffic, mapStyleUrlDay: "mapbox://styles/mapbox/light-v11", // mapStyleUrlNight: "mapbox://styles/mapbox/dark-v11", units: VoiceUnits.imperial, simulateRoute: true, language: "en", ), onRouteEvent: (event) { debugPrint("EVENT ${event.eventType}"); }, onCreated: (controller) async { mapCtrl.value = controller; await mapCtrl.value?.initialize(); // controller.buildRoute(wayPoints: wayPoints); }, ),

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

samderlust commented 10 months ago

@eopeter I've already set up the access key.

eopeter commented 10 months ago

Where did you put the Mapbox access token? Do you have the console output when the page loads? Does it work without the MapStyleUrl?

samderlust commented 10 months ago

@eopeter i put it in a .netrc file. and don't have any log to console

samderlust commented 10 months ago

it doesn't work without MapStyleUrl too

samderlust commented 10 months ago

I've also use mapbox_maps_flutter in my app

samderlust commented 10 months ago

This is what I got in xcode console. not display in flutter console

[Error, maps-core]: {}[Setup]: Failed to load style: HTTP status code 401
[Error, events_service]: Events sending aborted
[Error, events_service]: Events sending aborted
eopeter commented 10 months ago

The access token needs to be in your info.plist

samderlust commented 10 months ago

yes I put it under <key>MBXAccessToken</key>

samderlust commented 10 months ago

@eopeter Do I need a different token for Navigation SDK or can be used same one with Maps SDK