leafletjs 0.0.0+2

  • README.md
  • Installing
  • Versions
  • 54


Leaflet integration to Dart

Note: draft version, not all functionality supported.


Manually import:

  <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css"/>
  <script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>

API wrappers follows reference: http://leafletjs.com/reference.html


  _initMap() {
    _map = new Leaflet.Map("map", new Leaflet.MapOptions(
        center: new Leaflet.LatLng(60.222296, 24.929713),
        zoom: 11));
    new Leaflet.TileLayer(
        new Leaflet.TileLayerOptions(
            attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
            maxZoom: 18,
            id: 'your.project.id',
            accessToken: 'your.access.token'

Also it includes extra util that supports conversion from Encoded Polyline Algorithm Format to List<LatLng> and back

 List<LatLng> decoded = PolylineUtil.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@');

 // returns a string-encoded polyline
 String encoded = PolylineUtil.encode([new LatLng(38.5, -120.2), new LatLng(40.7, -120.95), new LatLng(43.252, -126.453)]);

Use this package as a library

1. Depend on it

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

  leafletjs: "^0.0.0+2"

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:leafletjs/leafletjs.dart';
Version Uploaded Documentation Archive
0.0.0+2 Jul 1, 2016 Go to the documentation of leafletjs 0.0.0+2 Download leafletjs 0.0.0+2 archive
0.0.0+1 Jun 26, 2016 Go to the documentation of leafletjs 0.0.0+1 Download leafletjs 0.0.0+1 archive


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
48 / 100
Code health derived from static analysis. [more]
97 / 100
Reflects how tidy and up-to-date the package is. [more]
4 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: web, other

Primary library: package:leafletjs/leafletjs.dart with components: js.


  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Package is getting outdated.

    The package was released 101 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 15 hints.

    Run dartfmt to format lib/leafletjs.dart.

    Run dartfmt to format lib/leafletjs_util.dart.

    Similar analysis of the following files failed:

    • lib/src/feature.group.dart (hint)
    • lib/src/icon.dart (hint)
    • lib/src/ilayer.dart (hint)
    • lib/src/lat.lng.bounds.dart (hint)
    • lib/src/lat.lng.dart (hint)
    • lib/src/layer.group.dart (hint)
    • lib/src/map.dart (hint)
    • lib/src/marker.dart (hint)
    • lib/src/path.dart (hint)
    • lib/src/path.options.dart (hint)
    • lib/src/point.dart (hint)
    • lib/src/polyline.dart (hint)
    • lib/src/tile.layer.dart (hint)
  • 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.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use leafletjs.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.1 <2.0.0
js ^0.6.0 0.6.1
Dev dependencies
browser ^0.10.0+2