mgrs_dart 1.0.1

Dart native js
Flutter Android iOS web

Utility for converting between WGS84 lat/lng and MGRS coordinates (Dart version of proj4js/mgrs).

mgrs_dart #

Utility for converting between WGS84 lat/lng and MGRS coordinates (Dart version of proj4js/mgrs).

Has 3 methods

  • toPoint, takes an mgrs string, returns an array of [lon,lat]
  • forward, takes an array of [lon,lat] and optional accuracy and returns an mgrs string
  • inverse, takes an mgrs string and returns a bbox.
  import 'package:mgrs_dart/mgrs_dart.dart';

  void main() {
    List<double> point = [-115.08209766323476, 36.236123461597515];
    String mgrsString = '11SPA7234911844';
    int accuracy = 5;

    // toPoint()
    var calculatedPoint = Mgrs.toPoint(mgrsString);
    print("Mgrs.toPoint('$mgrsString') = $calculatedPoint;");

    // forward()
    var calculatedMgrsString = Mgrs.forward(point, accuracy);
    print("Mgrs.forward($point, $accuracy) = '$calculatedMgrsString';");

    // inverse()
    var calculatedBox = Mgrs.inverse(mgrsString);
    print("Mgrs.inverse('$mgrsString') = $calculatedBox;");
  }
0
likes
110
pub points
97%
popularity

Utility for converting between WGS84 lat/lng and MGRS coordinates (Dart version of proj4js/mgrs).

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

fegyi001@gmail.com

License

MIT (LICENSE)

Dependencies

unicode

More

Packages that depend on mgrs_dart