eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
217 stars 187 forks source link

How to stop simulated routing #297

Closed mbaka-bilal closed 1 year ago

mbaka-bilal commented 1 year ago

I have passed the argument to stop simulated routing but it does not stop

final start = WayPoint(
        name: "Start",
        latitude: provider.startingPosition!.latitude,
        longitude: provider.startingPosition!.longitude,
        isSilent: false);
    final destination = WayPoint(
        name: "Destination",
        latitude: provider.destinationPosition!.latitude,
        longitude: provider.destinationPosition!.longitude,
        isSilent: false);

    var wayPoints = <WayPoint>[];
    wayPoints.add(start);
    wayPoints.add(destination);

    final _navigationOption = MapBoxNavigation.instance.getDefaultOptions();
    _navigationOption.simulateRoute = false;

    MapBoxNavigation.instance.registerRouteEventListener(_onRouteEvent);
    MapBoxNavigation.instance.setDefaultOptions(_navigationOption);

    await MapBoxNavigation.instance.startNavigation(
        wayPoints: wayPoints,
        options: MapBoxOptions(
          simulateRoute: false,
        ));

am i missing something?.

It does not follow my current position either, it just simulates everything, i have tested with android emulator routes, it works on my google_maps display the route changes according to my current location but does not work with this package.

eopeter commented 1 year ago

Is this on iOS or Android. Is this on the simulator/emulator or real device? Will always simulate on simulator or emulator

mbaka-bilal commented 1 year ago

okay didn't know that it will always simulate on emulator, let me try it on a real device thank you. @eopeter