For navigation feature in my app, I am using Mapbox SDK. Following is a snippet that I am using.
func showNavigationMap() {
let origin = Waypoint(coordinate: currentLocation.coordinate, name: "Your Location")
guard pickUpCoordinate != nil, dropOffCoordinate != nil else {
showAlertMessage("Locations not generated")
return
}
let pickUpLocation = Waypoint(coordinate: pickUpCoordinate, name: "Pickup Location")
let deliveryLocation = Waypoint(coordinate: dropOffCoordinate, name: "Delivery Location")
let options = NavigationRouteOptions(waypoints: [origin, pickUpLocation, deliveryLocation])
Directions.shared.calculate(options) { (waypoints, routes, error) in
guard let route = routes?.first else {
self.showAlertMessage("No possible routes detected")
return
}
self.mapNavigationViewController = NavigationViewController(for: route)
self.mapNavigationViewController.delegate = self
self.present(self.mapNavigationViewController, animated: true, completion: {
print("Navigation shown")
})
}
}
The sample screen is as shown below.
The first stop location is indicated as "1". I would like this location to be represented by some custom marker image. I have tried the mapbox documentation (https://www.mapbox.com/ios-sdk/navigation/examples/custom-destination-marker/). However, I could change the destination marker only. Is it possible to change the marker for the desired location?
