搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。