maps_toolkit 1.0.1+2

maps_toolkit #

Pub Package Build Status Coverage Status GitHub Issues GitHub Forks GitHub Stars GitHub License

A library for area, distance, heading measurements (spherical_util.dart if port from android-maps-utils).

Getting Started #

In your dart/flutter project add the dependency:

   maps_toolkit: ^1.0.1+1

A simple usage example:

import 'package:maps_toolkit/maps_toolkit.dart';

main() {
  val distanceBetweenPoints = SphericalUtil.computeDistanceBetween(
    LatLng(51.5073509, -0.1277583),
    LatLng(48.856614, 2.3522219)

List of functions #

  • SphericalUtil.computeArea - calculate the area of a closed path on Earth.
  • SphericalUtil.computeDistanceBetween - calculate the distance between two points, in meters.
  • SphericalUtil.computeHeading - calculate the heading from one point to another point.
  • SphericalUtil.computeLength - calculate the length of the given path, in meters, on Earth.
  • SphericalUtil.computeOffset - calculate the point resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north).
  • SphericalUtil.computeOffsetOrigin - calculate the location of origin when provided with a point destination, meters travelled and original heading.
  • SphericalUtil.computeSignedArea - calculate the signed area of a closed path on Earth.
  • SphericalUtil.interpolate - calculate the point which lies the given fraction of the way between the origin and the destination.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.1+2 #

  • fix lint issues

1.0.1+1 #

  • Fix typos

1.0.1 #

  • Documentation update

1.0.0 #

  • Initial version
  • Add SphericalUtil (port from android-maps-utils)


import 'package:maps_toolkit/maps_toolkit.dart';

void main() {
  final cityLondon = LatLng(51.5073509, -0.1277583);
  final cityParis = LatLng(48.856614, 2.3522219);

  final distance =
      SphericalUtil.computeDistanceBetween(cityLondon, cityParis) / 1000.0;

  print('Distance between London and Paris is $distance km.');

Use this package as a library

1. Depend on it

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

  maps_toolkit: ^1.0.1+2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:maps_toolkit/maps_toolkit.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:maps_toolkit/maps_toolkit.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
pedantic ^1.8.0 1.8.0+1
Dev dependencies
test ^1.6.5