Search code examples
xamarin.androidmapboxmapbox-android

MapboxOptimizedTrips missing from package MapboxSDK.AndroidServices (Xamarin.Android)


I'm currently implementing MapBox in a Xamarin.Android application, I'm looking at the examples from MapBox Github, this one in specific https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/OptimizationActivity.java, which I'm translating to C#, but now I'm facing a problem. In this example they use a class called "MapboxOptimizedTrips" which comes from lib 'com.mapbox.services.api.optimizedtrips.v1.MapboxOptimizedTrips'. In Xamarin I have imported all libraries that Xamarin made for MapBox, which is these 3:

  • MapBoxSDK.Android
  • MapBoxSDK.AndroidServices
  • MapBoxSDK.JavaServices

None of these includes the Optimized Trips API related classes. Has anyone faced this issue before?

Screenshot of code


Solution

  • I thought you read and followed this document from Mapbox?

    1. Mapbox Navigation library is kept changing and adding new features
    2. There are two DirectionsRoute class from Mapbox libraries
    3. both DirectionsRoute returned by Mapbox Optimization packages doesn't fit with what NavigationRoute does.

    I think you have to go with the way you mentioned, call to API directly. Or wait for Mapbox to evolve their library.

    Cheers.