搜索插件、代码仓与 APP 分类

插件详情v0.0.1+1

georouter

一个使用开源路由机(OSRM)API 获取两点间路线的包。支持多种出行模式,包括驾车、步行、骑行和公共交通。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4
喜欢数
25
Pub 分数
130

安装插件

flutter pub add georouter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

GeoRouter 是一个 Flutter 包,可让开发者使用开源路由机 (OSRM) API 在地理点之间获取路线。它支持多种出行模式,如驾车、步行、骑行和公共交通,非常适合用于基于位置的应用程序中的导航和路线规划功能。该包兼容所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,确保跨平台项目中行为一致。通过 Flutter 的 pub 包管理器进行简单集成,GeoRouter 将复杂的路由逻辑简化为简单且可重复使用的方法。

适合场景

  • 导航应用
  • 路线规划工具
  • 配送追踪系统
  • 骑行和步行路线查找器
  • 公共交通路线建议

主要特点

  • 支持多种出行方式
  • 使用 OSRM API 进行精确路线规划
  • 跨平台兼容性
  • 与 Flutter 的简单集成
  • 实时方向获取

适合对象

  • 开发导航功能的开发者
  • 需要多模态路由的应用程序
  • 跨平台地理位置应用
  • 具有路线可视化的位置感知服务

使用建议

  • 需要互联网连接以进行API调用
  • 取决于OSRM服务器的可用性
  • 高用量可能需要速率限制
  • 路由算法的自定义有限

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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

  • 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

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。