osrm 0.0.7 copy "osrm: ^0.0.7" to clipboard
osrm: ^0.0.7 copied to clipboard

Open Source Routing Machine (OSRM) client for Dart.

image

OSRM Dart Client (Docs) #

pub package pub package Pub Version popularity likes

This package is the OSRM client for Dart and Flutter. It provides a simple and easy-to-use interface for communicating with an OSRM server and retrieving routing and other information.

and of course, because it's written in Dart, it can be used in any platform that supports Dart.

<a href="https://www.buymeacoffee.com/mohamadlounnas"><img src="https://img.buymeacoffee.com/button-api/?text=Sponsor This Project&emoji=&slug=mohamadlounnas&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff">``</a>

Installation #

To use this package, simply add it to your pubspec.yaml file: dependencies: osrm:

Usage #

To use the OSRM client, first create an instance of the OSRM class:

Simple use #

nearest service

NearestResponse response = await osrm.nearest(
  NearestOptions(
    coordinate: (-0.1234, 51.1234),
    number: 3
  ),
);

routing (directions in GoogleMap) service

final route = await osrm.route(
  RouteRequest(
    coordinates: [
      (-0.1234, 51.1234), // Point A
      (-0.1234, 51.1234), // Point B
      (-0.1234, 51.1234), // Point C
    ],
    alternatives: OsrmAlternative.true_,
    steps: true,
    annotations: OsrmAnnotation.true_,
    overview: OsrmOverview.full,
    continueStraight: OsrmContinueStraight.true_,
    format: OsrmFormat.json,
    waypoints: [
      /// Waypoints are listed in order of visit
      OsrmWaypoint(
        distance: 0.0,
        location: (-0.1234, 51.1234),
      ),
    ],
  ),
);

this package under development.

TODO #

  • ✅ add Nearest service
  • ✅ add Nearest service tests
  • ✅ add Route service
  • ✅ add Route service tests
  • ✅ add dart example
  • ✅ add flutter example
  • ✅ add Match service (thanks to @Matix-Media) PR #33 read docs for more info
  • ❌ add Table service
  • ❌ add trip service
  • ❌ add Tile service
  • ❌ integrate with flutter ()

Sponcer? #

any contrubutions/support ... sponcer whynot; are welcome :)

Contact me: mohamadlounnas@gmail.com

Github: @mohamadlounnas

Linkedin: @mohamadlounnas

21
likes
130
points
332
downloads
screenshot

Publisher

verified publisherphysia.dev

Weekly Downloads

Open Source Routing Machine (OSRM) client for Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, http, recase

More

Packages that depend on osrm