We rolled out a new and better SDK for you.
You can display a route on the map and customize its origin and destination icons. It is also possible to specify the fill color, outline color, and width of the route.
Sample use case: When you add the route, you would like to highlight the starting and the destination points. Also you would like to plan several routes simultaneously with different origin and destination points and use different icons.
TTMapView: The *mapView object was created and configured. Route coordinates are prepared.
Origin and destination icons customization
If you need to customize the start and destination icons, you should create the icons through the UIImage class.
The icon can be created in the following ways:
You can create a route with custom style properties like fill color, outline color, and width. First, you need to create a RouteStyle object:
Next, you need to pass the
mapRoute object to
addRoute`method of the `mapView.routeManager object, e.g.,:
If you provide nil for
imageEnd there will be no icons on the route. If you don’t
call a style, then the default style will be applied.
Route segmented customization
You can create a route with segmented sections where each segment contains custom-style properties like fill color, outline color, and width.