Skip to main content

mapbox_api 1.1.0 copy "mapbox_api: ^1.1.0" to clipboard
mapbox_api: ^1.1.0 copied to clipboard

Unofficial Mapbox Dart SDK that follow official Mapbox documentation.

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 ✖️
Taster Tiles ✖️
Static Images ✖️
Static Tiles ✖️
Styles ✖️
Tilequery ✖️
Uploads ✖️
Mapbox Tiling Service ✖️
Datasets ✖️
Fonts ✖️
Service Implemented Example
Directions ✅ example/example.dart
example/example_directions_flutter.dart
Isochrone ✅
Map Matching ✅
Matrix ✅
Optimization ✅
Service Implemented Batch Example
Forward Geocoding ✅ ✅ example/example_forward_search.dart
Reverse Geocoding ✅ ✅ example/example_reverse_search.dart
Intersection ✅ ✖️ example/example_intersection_search.dart

Accounts #

Service Implemented
Tokens ✖️

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.

26
likes
150
points
228
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Unofficial Mapbox Dart SDK that follow official Mapbox documentation.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

http

More

Packages that depend on mapbox_api