搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。