Commit 827cd3e7 authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

use npm version of mgrs

parent 17b31850
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
var mgrs = require('./mgrs');
var mgrs = require('mgrs');

function Point(x, y, z) {
  if (!(this instanceof Point)) {
@@ -50,13 +50,9 @@ function Point(x, y, z) {
}

Point.fromMGRS = function(mgrsStr) {
  var llbbox = mgrs.inverse(mgrsStr);
  return new Point((llbbox[2] + llbbox[0]) / 2, (llbbox[3] + llbbox[1]) / 2);
  return new Point(mgrs.toPoint(mgrsStr));
};
Point.prototype.toMGRS = function(accuracy) {
  return mgrs.forward({
    lon: this.x,
    lat: this.y
  }, accuracy);
  return mgrs.forward([this.x, this.y], accuracy);
};
module.exports = Point;
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -5,6 +5,6 @@ proj4.WGS84 = new proj4.Proj('WGS84');
proj4.Point = require('./Point');
proj4.defs = require('./defs');
proj4.transform = require('./transform');
proj4.mgrs = require('./mgrs');
proj4.mgrs = require('mgrs');
proj4.version = require('./version');
module.exports = proj4;
 No newline at end of file

lib/mgrs.js

deleted100644 → 0
+0 −888

File deleted.

Preview size limit exceeded, changes collapsed.

+4 −1
Original line number Diff line number Diff line
@@ -38,5 +38,8 @@
    "grunt-contrib-uglify": "~0.2.4",
    "curl": "git://github.com/cujojs/curl.git",
    "istanbul": "~0.1.44"
  },
  "dependencies": {
    "mgrs": "0.0.0"
  }
}