google_maps 3.4.1

Dart Google Maps #

This project is a library to use Google Maps JavaScript API v3 from dart scripts.

Usage #

To use this library in your code:

  • add a dependency in your pubspec.yaml :

    dependencies:
      google_maps: ">=3.0.0 <4.0.0"
    
  • 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 'dart:html';

import 'package:google_maps/google_maps.dart';

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

Coverage #

The library covers all Google Maps JavaScript API v3 and its Libraries. To use one or more Google Maps Library:

  • add import in your dart code:

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

    <script src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=LIBRARY1,LIBRARY2"></script>
    

Examples #

Examples found at https://google-developers.appspot.com/maps/documentation/javascript/examples/ are available in a dart version at https://github.com/a14n/dart-google-maps in the example directory.

License #

Apache 2.0

v3.4.1 (2019-07-11) #

  • Fix issue with MVCArray.onRemoveAt and MVCArray.onRemoveAt.

v3.4.0 (2019-06-25) #

  • Potentially breaking changes: the following function can now be set directly without dealing with JsObject
    • ImageMapType.getTile
    • ImageMapTypeOptions.getTileUrl
    • MapType.getTile
    • Projection.fromLatLngToPoint and Projection.fromPointToLatLng
    • StyledMapType.getTile
    • OverlayView.draw, OverlayView.onAdd, and OverlayView.onRemove
  • Fix StreetViewService.getPanorama to follow the documentation.

v3.3.4 (2019-06-21) #

v3.3.3 (2018-12-24) #

v3.3.2 (2018-08-07) #

  • fix build.

v3.3.1 (2018-08-07) #

  • remove func dependency.

v3.3.0 (2018-07-27) #

  • migration to Dart 2.

v3.2.4 (2018-04-11) #

  • Fix another issue with Dart-2

v3.2.3 (2018-04-07) #

  • Fix some issue with Dart-2

v3.2.2 (2017-08-28) #

  • Support some additions from Google Maps API 3.28

v3.2.1 (2017-06-20) #

v3.2.0+2 (2017-01-16) #

v3.2.0+1 (2016-11-16) #

  • update to handle stricter markdown

v3.2.0 (2016-11-15) #

  • use js_wrapping-0.3.0
  • no more generator dependencies grabbed

v3.1.0 (2015-12-17) #

  • support of the Google Maps API 3.22

v3.0.2 (2015-06-16) #

v3.0.1 (2015-06-12) #

v3.0.0 (2015-06-05) #

  • support of the Google Maps API 3.20
  • migration to js_wrapping-0.2.0

Semantic Version Conventions #

http://semver.org/

  • Stable: All even numbered minor versions are considered API stable: i.e.: v1.0.x, v1.2.x, and so on.
  • Development: All odd numbered minor versions are considered API unstable: i.e.: v0.9.x, v1.1.x, and so on.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  google_maps: ^3.4.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:google_maps/google_maps.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
93
Learn more about scoring.

We analyzed this package on Sep 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: web

Primary library: package:google_maps/google_maps.dart with components: html, js.

Health issues and suggestions

Document public APIs. (-0.99 points)

2905 out of 2906 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/google_maps_src.g.dart.

Run dartfmt to format lib/src/google_maps_src.g.dart.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and google_maps.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.67.0 <3.0.0
js_wrapping ^0.5.0 0.5.0
meta ^1.1.2 1.1.7
Dev dependencies
build_runner ^0.9.2
build_test ^0.10.3
build_web_compilers ^0.4.0
html ^0.13.3
js_wrapping_generator ^0.5.0
package_resolver 1.0.9
test ^1.3.0