eopeter / flutter_mapbox_navigation

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

Options like zoom and tilt not being applied in MapBoxNavigationView #314

Closed jules-jayet closed 8 months ago

jules-jayet commented 11 months ago

Hello,

I've encountered an issue with the flutter_mapbox_navigation package where certain options, like zoom and tilt, don't seem to be applied when set for MapBoxNavigationView.

Steps to Reproduce:

  1. Clone the project and run the provided example.
  2. Modify the default options for MapBoxNavigationView by changing the zoom and tilt values.
  3. Launch the app and observe the map view.

Code: I used the example code provided with the package and simply modified the options as follows:

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initialize() async {
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    _navigationOption = MapBoxNavigation.instance.getDefaultOptions();
    _navigationOption.simulateRoute = true;
    _navigationOption.initialLatitude = 45;
    _navigationOption.initialLongitude = 5;
    _navigationOption.zoom = 10.0;
    _navigationOption.tilt = 5.0;

  }

Expected Result: The map view should reflect the modified options, with a zoom set to 10.0 and tilt set to 5.0.

Actual Result: The modified options don't seem to be applied, and the map view remains unchanged.

Environment: Flutter 3.13.4 flutter_mapbox_navigation: 0.2.0 Platform: Android

I'd appreciate it if you could take a look at this issue. Thank you in advance for your assistance and for the work you've done on this package!

Best regards

mrwadepro commented 10 months ago

I am also having issues with the tilt not being applied, not sure what is causing this just yet.

eopeter commented 8 months ago

Stale issue message