buildEvRoutePlanningOptions

fun buildEvRoutePlanningOptions(itinerary: Itinerary, chargingOptions: ChargingOptions, @IntRange(from = 0, to = 2) maxAlternatives: Int = 0, avoids: Set<AvoidType> = emptySet(), language: Locale = Locale.ENGLISH, instructionPhoneticsType: InstructionPhoneticsType = InstructionPhoneticsType.Ipa): RoutePlanningOptions

Deprecated

This will be removed from future releases after 2027-04-19. Use com.tomtom.sdk.routing.options.buildEvRoutePlanningOptions with the builder lambda instead. Move each explicit parameter into the trailing lambda.

Replace with

import com.tomtom.sdk.routing.options.buildEvRoutePlanningOptions
buildEvRoutePlanningOptions(itinerary, chargingOptions) { }

Creates EV options for planning routes which are passed to one of the various route planners.

Prefer the builder-style com.tomtom.sdk.routing.options.buildEvRoutePlanningOptions, which configures the options through a RoutePlanningOptions.EvBuilder lambda. To migrate, change the import to the com.tomtom.sdk.routing.options package and move each explicit parameter into the trailing lambda, for example:

val options = buildEvRoutePlanningOptions(itinerary = itinerary, chargingOptions = chargingOptions) {
maxAlternatives = 2
}

Parameters

itinerary

The list of route locations.

chargingOptions

Represents options related to the battery charging.

maxAlternatives

Maximum number of desired alternative routes. Value must be in range: 0,2.

avoids

What kind of roads should be be avoided while calculating a route. Default value is an empty set.

language

The locale of guidance instruction and road name sections. Default value is Locale.ENGLISH.

instructionPhoneticsType

The phonetics type of the guidance instructions. Default value is InstructionPhoneticsType.Ipa.

Throws

when:

  • maxAlternatives is set to a value outside 0, 2.

  • VehicleProvider.vehicle is not set to Vehicle.Car.