mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
265 stars 125 forks source link

`showDirections` on Google Maps on iOS doesn't work with waypoints #94

Closed luckyhandler closed 1 year ago

luckyhandler commented 2 years ago

I'm using map_launcher: ^2.1.1

When opening showDirections with waypoints in Google Maps on iOS I'm stuck on the following screen

IMG_CADFAB619192-1

The code I'm using is

  await map.showDirections(
    origin: Coords(
      departure.latitude,
      departure.longitude,
    ),
    originTitle: departure.address?.urydeAddressStringMedium ?? '',
    destination: Coords(
      destination.latitude,
      destination.longitude,
    ),
    destinationTitle: destination.address?.urydeAddressStringMedium ?? '',
    waypoints: waypoints.map((e) => Coords(e.latitude, e.longitude)).toList(),
    directionsMode: rideType == RideType.passenger
        ? DirectionsMode.walking
        : DirectionsMode.driving,
  );

if waypoints is assigned an empty list or null it works.

On Android the same code works.

The coordinates I'm using are lat: 49.48896, lng: 10.94142 and lat: 49.46992, lng: 11.00541. I added a screenshot of the waypoint list content:

waypoints

Any idea what causes the issue?

▶ flutter doctor -v                      
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale de-DE)
    • Flutter version 2.5.3 at /Users/ninohandler/Development/sdks/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision 18116933e7 (vor 3 Wochen), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/ninohandler/Development/sdks/android
    • Platform android-31, build-tools 30.0.2
    • ANDROID_HOME = /Users/ninohandler/Development/sdks/android
    • Java binary at: /Applications/Android Studio 4.0.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio 4.0.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] IntelliJ IDEA Community Edition (version 2021.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 62.0.3
    • Dart plugin version 212.5632

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (4 available)
    • ONEPLUS A5000 (mobile)   • b6ec3a64                  • android-arm64  • Android 10 (API 29)
    • iPhone von Nino (mobile) • 00008101-000E54290C68001E • ios            • iOS 15.0.2 19A404
    • macOS (desktop)          • macos                     • darwin-x64     • macOS 12.0.1 21A559 darwin-x64
    • Chrome (web)             • chrome                    • web-javascript • Google Chrome 95.0.4638.69

• No issues found!
mattermoran commented 2 years ago

Sorry for taking so much time to test this. I have tried on iOS with the coordinates you provided and it seems to work fine. Is this still an issue for you? If yes, what happens when you click the "Continue" button? And could you provide some more info for me to test on my side?

mattermoran commented 1 year ago

I've tested again and it seems to be ok. Let me know if it's still an issue