diff --git a/CHANGELOG.md b/CHANGELOG.md index 997bf3b..2d22cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 1.0.0: add valhalla route API +* break changes: + * replace OSRMManager with RoutingManager + * replace getRoad with getRoute + * remove buildInstruction ( becone integrated automatically with route object ) + * replace Road by Route + * replace return of OSRM api to OSRMRoad +* create OSRMService for osrm apis +* create ValhallaService for valhalla apis + ## 0.5.5: fix bug * fix bug related to generate path for getRoute ## 0.5.4: diff --git a/README.md b/README.md index 8a255ea..9c10f74 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,72 @@ ## Routing Client Dart Package -![pub](https://img.shields.io/badge/pub-v0.5.5-orange) +![pub](https://img.shields.io/badge/pub-v1.0.0-blue) > Package for osm routing client api -> for now this package support only server based on osrm-backend +> we support routing API for osrm-backend +> also Valhalla Route API (more APIs will be added ) +> openrouteservice (coming soon) +> from 1.0.0 instruction will be included directly when requesting the route +> you can use our osrm service or valhalla service directly insteado of our RoutingManager ### client api support * OSRM Client Api * route service * trip service +* Valhalla Client + * route service API ## Installing Add the following to your `pubspec.yaml` file: dependencies: - routing_client_dart: ^0.5.5 + routing_client_dart: ^1.0.0 -### example for route service +### example for osrm route service ```dart -List waypoints = [ + List waypoints = [ LngLat(lng: 13.388860, lat: 52.517037), LngLat(lng: 13.397634, lat: 52.529407), LngLat(lng: 13.428555, lat: 52.523219), ]; - final manager = OSRMManager(); - final road = await manager.getRoad( - waypoints: waypoints, - geometries: Geometries.polyline, - steps: true, - languageCode: "en", + final manager = RoutingManager(); + final route = await manager.getRoute( + OSRMRequest.route( + waypoints: waypoints, + geometries: Geometries.polyline, + steps: true, + languages: Languages.en, + ) ); ``` -### example for trip service +### example for osrm trip service ```dart -List waypoints = [ + List waypoints = [ LngLat(lng: 13.388860, lat: 52.517037), LngLat(lng: 13.397634, lat: 52.529407), LngLat(lng: 13.428555, lat: 52.523219), ]; - final manager = OSRMManager(); - final road = await manager.getTrip( - waypoints: waypoints, - roundTrip:false, - source: SourceGeoPointOption.first, - destination: DestinationGeoPointOption.last, - geometries: Geometries.polyline, - steps: true, - languageCode: "en", + final manager = RoutingManager(); + final road = await manager.getRoute( + OSRMRequest.trip( + waypoints: waypoints, + destination: DestinationGeoPointOption.last, + source: SourceGeoPointOption.first, + geometries: Geometries.polyline, + steps: true, + languages: Languages.en, + roundTrip:false, + ) ); ``` -### build instruction from road - -```dart - final instructions = await manager.buildInstructions(road); -``` - ### example for check Location in Road ```dart @@ -84,3 +88,7 @@ final instruction = await roadManager.nextInstruction(instructions, road, curren **Warning** the precision of `LngLat` should be 5 if the road contain `polylineEncoded`, or the same precies as `LngLat` in `polylines` **Note** you can get some inaccurate information `nextInstruction`,for that we will be happy for yours contributions + +**Note** you can get voice instruction for valhalla instruction + +**Note** more documentation will be added to soon diff --git a/pubspec.yaml b/pubspec.yaml index 08d2c5b..4b9fd58 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: routing_client_dart -description: Dart Package for Routing Client Api ( support OSRM project ) -version: 0.5.5 +description: Dart Package for Routing Client Api ( support OSRM/Valhalla project ) +version: 1.0.0 homepage: https://github.com/liodali/OSM-Routing-Client-Dart environment: