georouter 0.0.1+1 copy "georouter: ^0.0.1+1" to clipboard
georouter: ^0.0.1+1 copied to clipboard

A package for getting directions between points using the Open Source Routing Machine (OSRM) API. Supports multiple travel modes, including driving, walking, cycling, and transit.

GeoRouter #

pub package License: MIT stars

GeoRouter is a Flutter package that provides an easy-to-use API to request directions between points using OpenStreetMap Route Service Machine (OSRM).

Features #

Features:

  • Request directions between two or more points using different travel modes (driving, walking, cycling, or transit).
  • Decode polylines returned by OSRM into a list of latitude/longitude points.
  • Handles errors and exceptions thrown by OSRM.

Getting Started #

  1. Add the following to your pubspec.yaml file: In your pubspec.yaml file, add the following dependency:
dependencies:
  georouter: <lastest>
  1. Import the package
import 'package:georouter/georouter.dart';
  1. Use package:
final georouter = GeoRouter(mode: TravelMode.driving);

final coordinates = [
  PolylinePoint(latitude: 51.5074, longitude: -0.1278), // London, UK
  PolylinePoint(latitude: 48.8566, longitude: 2.3522), // Paris, France
];

try {
final directions = await georouter.getDirectionsBetweenPoints(coordinates);
// Do something with the directions
} on GeoRouterException catch (e) {
// Handle GeoRouterException
} on HttpException catch (e) {
// Handle HttpException
}

Dependencies #

http: ^0.13.5
23
likes
120
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A package for getting directions between points using the Open Source Routing Machine (OSRM) API. Supports multiple travel modes, including driving, walking, cycling, and transit.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on georouter