OSRMManager class

OSRMManager

this class responsible to manage http call to get road from open-source osm server or custom server that should be specified in constructor based on osrm project contain only one public method getRoad to make the call and return Road object.

for more detail see : https://github.com/Project-OSRM/osrm-backend

server : (String) represent the osm server or any custom server that based of OSRM project

roadType : (RoadType) represent the type of road that you want to use, car or foot,bike only for osm servers

Constructors

OSRMManager()
OSRMManager.custom({required String server, RoadType roadType = RoadType.car, Dio? dio})

Properties

dio ↔ Dio
latefinal
hashCode int
The hash code for this object.
no setterinherited
roadType RoadType
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server String
final

Methods

buildInstruction(RoadStep step, Map<String, dynamic> instructionsHelper, Map<String, dynamic> option) String
inherited
buildInstructions(Road road, {Languages languages = Languages.en}) Future<List<RoadInstruction>>
buildInstructions
directionFromDegree(double? degree) String
inherited
generatePath(String server, String waypoints, {Profile profile = Profile.route, RoadType roadType = RoadType.car, bool steps = true, Overview overview = Overview.full, Geometries geometries = Geometries.polyline}) String
inherited
generateTripPath(String server, String waypoints, {RoadType roadType = RoadType.car, bool roundTrip = true, SourceGeoPointOption source = SourceGeoPointOption.any, DestinationGeoPointOption destination = DestinationGeoPointOption.any, bool steps = true, Overview overview = Overview.full, Geometries geometries = Geometries.polyline}) String
inherited
getRoad({required List<LngLat> waypoints, RoadType roadType = RoadType.car, bool alternative = false, bool steps = true, Overview overview = Overview.full, Geometries geometries = Geometries.geojson, Languages language = Languages.en}) Future<Road>
getRoad
getTrip({required List<LngLat> waypoints, RoadType roadType = RoadType.car, bool roundTrip = true, SourceGeoPointOption source = SourceGeoPointOption.any, DestinationGeoPointOption destination = DestinationGeoPointOption.any, bool steps = true, Overview overview = Overview.full, Geometries geometries = Geometries.polyline, Languages language = Languages.en}) Future<Road>
getTrip
isOnPath(Road road, LngLat currentLocation, {double tolerance = 0.1}) Future<bool>
isOnPath
laneConfig(RoadStep step) String?
inherited
loadInstructionHelperJson({Languages language = Languages.en}) Future<Map<String, dynamic>>
inherited
nextInstruction(List<RoadInstruction> instructions, Road road, LngLat currentLocation, {double tolerance = 0.1}) Future<TurnByTurnInformation?>
nextInstruction
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ordinalize({required Map<String, dynamic> instructionsV5, required String key}) String
inherited
retrieveName(RoadStep step) String
inherited
tokenize(String instruction, Map<String, String> tokens) String
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited