THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Long Distance EV Routing

Plan a route between a given origin and destination that automatically includes charging stops along the way with Long Distance EV Routing API that is available in Maps SDK. Long Distance EV Routing automatically adds charging stops to your route based on a number of parameters specific for your electric car and driving behavior. Have a look at the detailed documentation Long Distance EV Routing Long Distance EV Routing. Long Distance EV Routing can be used in variety of use cases that will help users of your app to plan routes for their electric cars to avoid car charging anxiety and enjoy peaceful driving. We prepared a few examples of such use cases.

Sample use case: You would like to plan a long route for your electric car that will take into consideration charging stops. Thanks to that, you will know in advance when you need to stop to charge your car. Also, you will be able to estimate how much energy will be consumed during the trip. Using TomTom Long Distance EV Routing you will be provided also with energy-efficient route with accurate battery consumption calculations, even considering the route profile and expected traffic.

Sample use case: You would like to see how much battery you have left when arriving at a stop so that you can find out what the options are if you need an alternative charger.

In order to plan an EV route, you need to set the vehicle parameters in your app such as vehicle weight, vehicle length, vehicle height and others. For your convenience we have created predefined examples of vehicle objects representing prototypical EV with different ranges defining how far will they really go on a single charge. This will help you to easily try out Long Distance EV Routing functionality without specifying all the detailed parameters defining the particular vehicle model.

Example showing a possible vehicle definition for a short range vehicle.

1let origin = TTCoordinate.AMSTERDAM()
2let destination = TTCoordinate.BERLIN()
3let vehicle = ElectricVehicle.shortRange
4let route = RouteOptions.fastestWithoutTraffic
5let chargeSchema = ShortRangeChargingSchema()
6evPlanner.planRoute(origin: origin, destination: destination, electricVehicle: vehicle, route: route, charging: chargeSchema) { [weak self] routes, _ in
7 guard let self = self else { return }
8 if let route = routes?.first {
9 self.drawRoute(route, vehicle: vehicle)
10 self.drawChargingStation(route)
11 } else {
12 self.handleNoRoutesFound()
13 }
14}
1CLLocationCoordinate2D origin = [TTCoordinate AMSTERDAM]
2CLLocationCoordinate2D destination = [TTCoordinate BERLIN];
3ElectricVehicle *vehicle = [ElectricVehicle shortRange];
4RouteOptions *routeOptions = [RouteOptions fastestWithoutTraffic];
5__weak LongDistanceEVRoutingViewController *weakSelf = self;
6ShortRangeChargingSchema *shortRange = [[ShortRangeChargingSchema alloc] init];
1[self.routePlanner planRouteWithOrigin:origin
2 destination:destination
3 electricVehicle:vehicle
4 route:routeOptions
5 charging:shortRange
6 completion:^(NSArray<FullRouteEV *> *_Nullable result, NSError *_Nullable error) {
7 LongDistanceEVRoutingViewController *strongSelf = weakSelf;
8 if (strongSelf != NULL) {
9 if (result != NULL && result.count > 0) {
10 [strongSelf displayRoute:result[0] forVehicle:vehicle];
11 [strongSelf drawChargingStation:result[0]];
12 } else {
13 [strongSelf handleNoRoutesFound];
14 }
15 }
16 }];

Example showing a possible vehicle definition for a long range vehicle.

1let origin = TTCoordinate.AMSTERDAM()
2let destination = TTCoordinate.BERLIN()
3let vehicle = ElectricVehicle.longRange
4let route = RouteOptions.fastestWithoutTraffic
5let chargeSchema = LongRangeChargingSchema()
1evPlanner.planRoute(origin: origin, destination: destination, electricVehicle: vehicle, route: route, charging: chargeSchema) { [weak self] routes, _ in
2 guard let self = self else { return }
3 if let route = routes?.first {
4 self.drawRoute(route, vehicle: vehicle)
5 self.drawChargingStation(route)
6 } else {
7 self.handleNoRoutesFound()
8 }
9 }
1CLLocationCoordinate2D origin = [TTCoordinate AMSTERDAM];
2CLLocationCoordinate2D destination = [TTCoordinate BERLIN];
3ElectricVehicle *vehicle = [ElectricVehicle longRange];
4RouteOptions *routeOptions = [RouteOptions fastestWithoutTraffic];
5LongRangeChargingSchema *shortRange = [[LongRangeChargingSchema alloc] init];
1__weak LongDistanceEVRoutingViewController *weakSelf = self;
2
3 [self.routePlanner planRouteWithOrigin:origin
4 destination:destination
5 electricVehicle:vehicle
6 route:routeOptions
7 charging:shortRange
8 completion:^(NSArray<FullRouteEV *> *_Nullable result, NSError *_Nullable error) {
9 LongDistanceEVRoutingViewController *strongSelf = weakSelf;
10 if (strongSelf != NULL) {
11 if (result != NULL && result.count > 0) {
12 [strongSelf displayRoute:result[0] forVehicle:vehicle];
13 [strongSelf drawChargingStation:result[0]];
14 } else {
15 [strongSelf handleNoRoutesFound];
16 }
17 }
18 }];

Screenshots presenting how the long EV distance routing functionality works.

image

Short Range

image

Long Range