inverse static method

List<double> inverse(
  1. String mgrs
)

Convert MGRS to lat/lon bounding box.

@param {string} mgrs MGRS string. @return {number,number,number,number} An array with left longitude), bottom (latitude), right (longitude) and top (latitude) values in WGS84, representing the bounding box for the provided MGRS reference.

Implementation

static List<double> inverse(String mgrs) {
  var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  if (bbox is LonLat) {
    return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
  } else if (bbox is BBox) {
    return [bbox.left, bbox.bottom, bbox.right, bbox.top];
  } else {
    throw Exception('Neither bbox, nor lonlat');
  }
}