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,
-122.246225,
],
<double>[
37.785939,
-122.194292,
],
],
);
if (response.error == null) {
}
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,
2.286020,
],
);
if (response.error == null) {
}
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
Search
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.