dartleaf 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

dart_leaflet #

dart JS interop package to wrap leaflet.js library in dart web application

0.0.1-dev.1 #

  • Initial version.

0.0.1-dev.2 #

  • Example with map drawing, GeoJSON export

0.0.1-dev.3 #

  • Applied code analysis suggestions of pub.dev analyzer

0.1.0 #

  • Adedd Handler class, LeafletMap Handler properties
  • Added Tooltips in the public API
  • Fixed the GeoJson return type from the Polyline primitive. Updated the example
  • Filled the prototype of the Bounds class
  • The version is raised to 0.1.0 as most of the leaflet functionality is now covered

0.1.1 #

  • Code format fixed with dartfmt

0.1.2 #

  • Removed type specification on List parameters - use List

example/main.dart

import 'dart:html';

import 'open_street_map.dart';

void main() {
  var map = OpenStreetMap("output");
  map.setView(lat: 43.21047, lng: 27.93470, zoom: 15);

  querySelectorAll('input[name=drawOption]').onClick.listen((MouseEvent e) {
    var btn = e.target as RadioButtonInputElement;
    map.draw(btn.id, btn.checked);
  });

  querySelector("#btnGetGeoJson").onClick.listen((_) {
      var json = map.geoJson;
      print(json);
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  dartleaf: ^0.1.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:dartleaf/dartleaf.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
js ^0.6.1 0.6.1+1
Dev dependencies
build_runner ^1.5.0
build_web_compilers ^2.1.0
pedantic ^1.7.0