google_maps 8.1.1 copy "google_maps: ^8.1.1" to clipboard
google_maps: ^8.1.1 copied to clipboard

With that package you will be able to use Google Maps JavaScript API from Dart scripts.

example/README.md

To use this library in your code:

  • add a dependency in your pubspec.yaml :

    dependencies:
      google_maps:
    
  • add import in your dart code:

    import 'package:google_maps/google_maps.dart';
    
  • Include the Maps API JavaScript using a script tag before your dart script.

    <script src="https://maps.googleapis.com/maps/api/js?key=API_KEY"></script>
    

Please see the Google Maps JavaScript API v3 Getting Started guide for information about obtaining an API Key.

A very simple example :

import 'package:google_maps/google_maps.dart';
import 'package:web/web.dart';

void main() {
  final mapOptions = MapOptions()
    ..zoom = 8
    ..center = LatLng(-34.397, 150.644);
  GMap(document.getElementById('map-canvas') as HTMLElement, mapOptions);
}

For other examples take a look at example folder on the repository.

122
likes
90
points
602k
downloads

Publisher

unverified uploader

Weekly Downloads

With that package you will be able to use Google Maps JavaScript API from Dart scripts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

meta, web

More

Packages that depend on google_maps