ValhallaRequest constructor
ValhallaRequest({
- String? id,
- required List<
LngLat> waypoints, - List<
LngLat> ? excludeLocations, - List? excludePolygones,
- ValhallaDirectionsType directionsType = ValhallaDirectionsType.instructions,
- BaseCostingOption? costingOption,
- Costing costing = Costing.auto,
- ValhallaUnit units = ValhallaUnit.km,
- Languages languages = Languages.en,
- DateTime? time,
- ValhallaFormat valhallaFormat = ValhallaFormat.json,
- Geometries? valhallaShapeFormat,
- bool? bannerInstructions,
- bool? voiceInstructions,
- int alternatives = 2,
Implementation
ValhallaRequest({
this.id,
required super.waypoints,
this.excludeLocations,
this.excludePolygones,
this.directionsType = ValhallaDirectionsType.instructions,
this.costingOption,
this.costing = Costing.auto,
this.units = ValhallaUnit.km,
super.languages,
this.time,
this.valhallaFormat = ValhallaFormat.json,
this.valhallaShapeFormat,
this.bannerInstructions,
this.voiceInstructions,
super.alternatives,
}) : assert(
waypoints.length == 2,
"we dont support more that 2 points for routing service for now",
),
assert(
languages != Languages.ar,
"arabic language not supported for now",
),
assert(
(valhallaFormat == ValhallaFormat.orsm &&
Geometries.values.contains(valhallaShapeFormat)) ||
valhallaFormat != ValhallaFormat.orsm,
);