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.
read-onlyinherited
roadType RoadType
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
server String
final

Methods

buildInstruction(RoadStep step, Map<String, dynamic> instructionsHelper, Map<String, dynamic> option) String
inherited
buildInstructions(Road road) 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 this method used to get route from trip service api used if you have more that 10 waypoint to generate route will more accurate than getRoad.
laneConfig(RoadStep step) String?
inherited
loadInstructionHelperJson({Languages language = Languages.en}) Future<Map<String, dynamic>>
inherited
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