搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.0

mapbox_api

非官方 Mapbox Dart SDK,遵循官方 Mapbox 文件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
200
喜歡數
26
Pub 分數
150

安裝套件

flutter pub add mapbox_api

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

mapbox_api 套件是 Mapbox 的非官方 Dart SDK,與官方 Mapbox 文件一致。它讓開發者能夠將 Mapbox 的地理定位和地圖功能整合到跨多個平台的 Flutter 應用中,包括 Android、iOS、Web、macOS、Windows 和 Linux。該套件提供簡單的介面來存取 Mapbox 服務,例如地圖渲染、地理編碼和路徑規劃,讓開發位置感知應用變得更容易,無需依賴原生平台程式碼。該套件由社群維護並託管於 GitHub。

適用情境

  • 在Flutter應用中整合互動地圖
  • 執行地理編碼和反向地理編碼
  • 實施路線規劃和導航
  • 顯示自定地圖樣式
  • 建構基於位置的分析儀表板

主要特色

  • 遵循官方 Mapbox API 文件
  • 跨平台支援(Android、iOS、Web、macOS、Windows、Linux)
  • Mapbox 服務的簡單 Dart 接口
  • 即時地圖渲染
  • 支援自定地圖瓦片和樣式

適合對象

  • Flutter 開發人員建構位置感知應用
  • 需要跨平台地圖整合的團隊
  • 需要 Mapbox 特定功能(如向量瓦片)的項目
  • 熟悉 Mapbox API 的開發人員
  • 同時針對行動和網路應用

使用建議

  • 非官方 SDK – 可能落後於官方更新
  • 需要 Mapbox API 金鑰
  • 與官方 SDK 相比,錯誤處理功能有限
  • 依賴第三方維護
  • 除了基本渲染外,沒有內建的地圖UI元件

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

mapbox_api

This package aim to :

Examples

See examples/ for all available examples

import 'package:mapbox_api/mapbox_api.dart';

MapboxApi mapbox = MapboxApi(
  accessToken: '<Mapbox API token>',
);

Get your API token on mapbox.com

Request directions services
final response = await mapbox.directions.request(
  profile: NavigationProfile.DRIVING_TRAFFIC,
  overview: NavigationOverview.FULL,
  geometries: NavigationGeometries.GEOJSON,
  steps: true,
  coordinates: <List<double>>[
    <double>[
      37.786060, // latitude
      -122.246225, // longitude
    ],
    <double>[
      37.785939, // latitude
      -122.194292, // longitude
    ],
  ],
);

if (response.error == null) {
  // response.routes ...
  // response.waypoints ...
}

see basic example: example/example.dart
see full example with flutter_gl: example/example_directions_flutter.dart

Request forward geocoding services
final response = await mapbox.forwardGeocoding.request(
  searchText: 'tour eiffel',
  fuzzyMatch: true,
  language: 'fr',
  proximity: <double>[
    48.858638, // latitude
    2.286020, // longitude
  ],
);

if (response.error == null) {
  // response.features ...
}

see full example : example/example_forward_search.dart

Supported API

Maps
Service Implemented
Vector Tiles :heavy_multiplication_x:
Taster Tiles :heavy_multiplication_x:
Static Images :heavy_multiplication_x:
Static Tiles :heavy_multiplication_x:
Styles :heavy_multiplication_x:
Tilequery :heavy_multiplication_x:
Uploads :heavy_multiplication_x:
Mapbox Tiling Service :heavy_multiplication_x:
Datasets :heavy_multiplication_x:
Fonts :heavy_multiplication_x:
Navigation
Service Implemented Example
Directions :white_check_mark: example/example.dart
example/example_directions_flutter.dart
Isochrone :white_check_mark:
Map Matching :white_check_mark:
Matrix :white_check_mark:
Optimization :white_check_mark:
Search
Service Implemented Batch Example
Forward Geocoding :white_check_mark: :white_check_mark: example/example_forward_search.dart
Reverse Geocoding :white_check_mark: :white_check_mark: example/example_reverse_search.dart
Intersection :white_check_mark: :heavy_multiplication_x: example/example_intersection_search.dart
Accounts
Service Implemented
Tokens :heavy_multiplication_x:

Related Packages

This SDK will work perfectly with flutter-mapbox-gl to display retrieved data (will work with any other package too). You may also need polyline package to convert polylines strings to coordinates.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。