marker_with_label 0.0.8 copy "marker_with_label: ^0.0.8" to clipboard
marker_with_label: ^0.0.8 copied to clipboard

Dart 1 only

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

Dart Marker With Labels #

This project is a library to use MarkerWithLabel for V3 from dart scripts.

See Google Maps for Dart

Usage #

To use this library in your code:

  • add a dependency in your pubspec.yaml :

    dependencies:
      google_maps: ">=3.0.0 <4.0.0"
      marker_with_labels: ">0.0.1 <1.0.0"
    
  • add import in your dart code:

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

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

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);
  
  var markerWithLabelOptions = new MarkerWithLabelOptions()
    ..labelContent = "Hello Label"
    ..map = gMap
    ..position = latLng;
  
  new MarkerWithLabel(markerWithLabelOptions);
}

Examples #

Examples found at https://github.com/googlemaps/v3-utility-library/tree/master/markerwithlabel/examples in the example directory.

License #

Apache 2.0

0
likes
40
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

google_maps, js_wrapping

More

Packages that depend on marker_with_label