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:
    
    copied to clipboard
  • add import in your dart code:

    import 'package:google_maps/google_maps.dart';
    
    copied to clipboard
  • 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>
    
    copied to clipboard

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);
}
copied to clipboard

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

122
likes
90
points
679k
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.10 - 2025.03.25

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

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

meta, web

More

Packages that depend on google_maps