mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
276 stars 126 forks source link

Waypoints not working in Apple Maps #191

Closed bjamturley closed 3 weeks ago

bjamturley commented 3 weeks ago

Hello, thanks for putting this package together. I have a basic example here which attempts to open a route with series of waypoints in Google and Apple Maps. This works fine in Google, but not in Apple where only the first waypoint appears as the destination. See the screenshots and minimal working example below. Any suggestions?

MapLauncher.Coords origin = MapLauncher.Coords(position.latitude, position.longitude);
MapLauncher.Coords destination = MapLauncher.Coords(_destination!.latitude, _destination!.longitude);
List<MapLauncher.Waypoint> waypoints = 
    waypointsList.map((point) => MapLauncher.Waypoint(point[0], point[1])).toList();

MapLauncher.DirectionsMode directionsMode;
switch (routeMode) {
  case RouteMode.walk:
    directionsMode = MapLauncher.DirectionsMode.walking;
    break;
  case RouteMode.bike:
    directionsMode = MapLauncher.DirectionsMode.bicycling;
    break;
  case RouteMode.drive:
    directionsMode = MapLauncher.DirectionsMode.driving;
    break;
}

MapLauncher.MapType mapType;
switch (service) {
  case 'google':
    mapType = MapLauncher.MapType.google;
    break;
  case 'apple':
    mapType = MapLauncher.MapType.apple;
    break;
  default:
    mapType = MapLauncher.MapType.google;
}

await MapLauncher.MapLauncher.showDirections(
  mapType: mapType,
  origin: origin,
  destination: destination,
  waypoints: waypoints,
  directionsMode: directionsMode,
);
drawing drawing
mattermoran commented 3 weeks ago

seems like apple maps does not support waypoints for walking. you can toggle the drive mode and will see waypoints for as expected. nothing really I can do here :(

bjamturley commented 3 weeks ago

Got it, thanks for the help. Hope they add the functionality in the future.