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

outdated

Unofficial Mapbox Dart SDK that follow official Mapbox documentation.

mapbox-api #

This package aim to :

🚧 WIP Notice #

This is a work in progress, feel free open an issue for questions and remarks. (PR are welcome :))

Examples #

See examples/examples.dart

import 'package:mapbox_api/mapbox_api.dart';

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

Get your API token on mapbox.com

Request directions services

DirectionsApiResponse response = await mapbox.directions.request(
  profile: NavigationProfile.DRIVING_TRAFFIC,
  overview: NavigationOverview.FULL,
  geometries: NavigationGeometries.POLYLINE6,
  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 ...
}

Request map matching services

MapMatchingApiResponse response = await mapbox.mapMatching.request(
  profile: NavigationProfile.WALKING,
  geometries: NavigationGeometries.GEOJSON,
  tidy: true,
  coordinates: <List<double>>[
    <double>[
      37.786060, // latitude
      -122.246225, // longitude
    ],
    <double>[
      37.785939, // latitude
      -122.194292, // longitude
    ],
  ],
);

if (response.error == null) {
  // response.matchings ...
  // response.tracepoints ...
}

Supported API #

Maps #

Service Implemented
Vector Tiles ✖️
Taster Tiles ✖️
Static Images ✖️
Static Tiles ✖️
Styles ✖️
Tilequery ✖️
Uploads ✖️
Mapbox Tiling Service ✖️
Datasets ✖️
Fonts ✖️
Service Implemented
Directions
Isochrone
Map Matching
Matrix
Optimization
Service Implemented
Geocoding ✖️

If you are looking for geocoding, take a look at ketanchoyal/mapbox_search

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.

25
likes
0
pub points
80%
popularity

Publisher

unverified uploader

Unofficial Mapbox Dart SDK that follow official Mapbox documentation.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on mapbox_api