mapbox_search 3.0.0-nullsafety.0 copy "mapbox_search: ^3.0.0-nullsafety.0" to clipboard
mapbox_search: ^3.0.0-nullsafety.0 copied to clipboard

outdated

A Flutter package for place search using MapBox Api and for Static map image

example/main.dart

import 'package:mapbox_search/mapbox_search.dart';

// import 'credentials.dart';
final MAPBOX_KEY = '';

Future<void> main() async {
  String apiKey = MAPBOX_KEY; //Set up a test api key before running

  await geoCoding(apiKey).catchError(print);
  await placesSearch(apiKey).catchError(print);
}

///Reverse GeoCoding sample call
Future geoCoding(String apiKey) async {
  var geoCodingService = ReverseGeoCoding(
    apiKey: apiKey,
    country: "BR",
    limit: 5,
  );

  var addresses = await geoCodingService.getAddress(Location(
    lat: -19.984846,
    lng: -43.946852,
  ));

  print(addresses);
}

///Places search sample call
Future placesSearch(String apiKey) async {
  var placesService = PlacesSearch(
    apiKey: apiKey,
    country: "BR",
    limit: 5,
  );

  var places = await placesService.getPlaces(
    "patio",
    location: Location(
      lat: -19.984634,
      lng: -43.9502958,
    ),
  );

  print(places);
}
87
likes
0
pub points
95%
popularity

Publisher

verified publisherketanchoyal.dev

A Flutter package for place search using MapBox Api and for Static map image

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on mapbox_search