THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Follow the chevron

Allow your users to follow their changing positions on the map e.g., when driving. When a new location is set, the animation moves the chevron to the new position.

Sample use case 1: You want to show your user position when driving.

Custom chevron indicator

You can set a custom icon for the chevron indicator.

To create a custom chevron:

let animation = TTChevronAnimationOptionsBuilder.create(withAnimatedCornerRounding: false).build()
chevron = TTChevronObject(normalImage: TTChevronObject.defaultNormalImage(), withDimmedImage: TTChevronObject.defaultDimmedImage(), with: animation)
TTChevronAnimationOptions *animation = [[TTChevronAnimationOptionsBuilder createWithAnimatedCornerRounding:true] build]
self.chevron = [[TTChevronObject alloc] initWithNormalImage:[TTChevronObject defaultNormalImage] withDimmedImage:[TTChevronObject defaultDimmedImage] withChevronAnimationOptions:animation];

Chevron tracking mode

Additionally, it is possible to track the chevron. It means that the camera/map and the chevron move when a new location is received so that the map is always centered on the chevron with the bearing of the drive. In the tracking mode, rotate and pan gestures are blocked. The user can only change the zoom level, while the map camera is automatically adjusted to follow the chevron.

To start tracking a selected chevron:

mapView.trackingManager.start(chevron)
[self.mapView.trackingManager startTrackingObject:self.chevron];

To stop tracking a selected chevron:

mapView.trackingManager.stop(chevron!)
[self.mapView.trackingManager stopTrackingObject:self.chevron];

To add route to the chevron source:

1let mapRoute = TTMapRoute(coordinatesData: plannedRoute,
2 with: TTMapRouteStyle.defaultActive(),
3 imageStart: TTMapRoute.defaultImageDeparture(),
4 imageEnd: TTMapRoute.defaultImageDestination())
5source = MapFollowTheChevronSource(trackingManager: mapView.trackingManager, routeManager: mapView.routeManager, trackingObject: chevron, route: mapRoute)
6source?.activate()
1TTMapRoute *mapRoute = [TTMapRoute routeWithCoordinatesData:result.routes.firstObject withRouteStyle:TTMapRouteStyle.defaultActiveStyle imageStart:TTMapRoute.defaultImageDeparture imageEnd:TTMapRoute.defaultImageDestination];
2self.source = [[MapFollowTheChevronSource alloc] initWithTrackingManager:self.mapView.trackingManager routeManager:self.mapView.routeManager trackingObject:self.chevron route:mapRoute];
3[self.source activate];

To set the chevron position on the screen:

mapView.trackingManager.setTrackingScreenCoordinates(CGPoint(x: 200, y: 500))
[self.mapView.trackingManager setTrackingScreenCoordinates:CGPointMake(200, 500)];

image

Chevron overview

image

Chevron tracking