Skip to content

Commit

Permalink
publish: 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Dec 16, 2024
1 parent 84cc57c commit 9dbf94b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
64 changes: 36 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -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<LngLat> waypoints = [
List<LngLat> 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<LngLat> waypoints = [
List<LngLat> 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
Expand All @@ -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
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 9dbf94b

Please sign in to comment.