marker_with_label 0.0.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

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

Changelog

0.0.1

  • Initial version, created by Stagehand

0.0.2

  • Fix package name, remove dart from name

0.0.3

  • Fix example dependency import

0.0.4

  • Add icon property on marker options

0.0.8

  • Add events

example/marker_with_label_example.dart

import 'dart:html';

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

void main() {
  var latLng = new LatLng(-34.397, 150.644);

  final mapOptions = new MapOptions()
    ..zoom = 8
    ..center = latLng;

  var gMap = new GMap(document.getElementById("map-canvas"), mapOptions);

  var markerWithLabelOptions = new MarkerWithLabelOptions()
    ..labelContent = "Hello Label"
    ..map = gMap
    ..position = latLng;

  var markerWithLabel = new MarkerWithLabel(markerWithLabelOptions);

  markerWithLabel.onClick.listen((e){
    print('Marker Click');
  });
}

1. Depend on it

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


dependencies:
  marker_with_label: "^0.0.8"

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:marker_with_label/marker_with_label.dart';
        
Version Uploaded Documentation Archive
0.0.8 Jul 15, 2017 Go to the documentation of marker_with_label 0.0.8 Download marker_with_label 0.0.8 archive
0.0.7 Jul 14, 2017 Go to the documentation of marker_with_label 0.0.7 Download marker_with_label 0.0.7 archive
0.0.6 Jul 14, 2017 Go to the documentation of marker_with_label 0.0.6 Download marker_with_label 0.0.6 archive
0.0.5 Jul 14, 2017 Go to the documentation of marker_with_label 0.0.5 Download marker_with_label 0.0.5 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50

Platforms

Detected platforms: web

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

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
google_maps >=3.0.0 <4.0.0 3.2.2
js_wrapping ^0.4.0 0.4.2
Transitive dependencies
func 0.1.1 1.0.0
meta 1.1.2
Dev dependencies
js_wrapping_generator ^0.4.0
test ^0.12.0