Commit 4993da70 authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

Point.toArray and non mangled names

parent 6ece8fda
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -38,7 +38,9 @@ module.exports = function(grunt) {
    uglify: {
      options: {
        report: 'gzip',
        mangle: true
        mangle:{
          except: ['proj4','Projection','Point']
        },
      },
      all: {
        src: 'dist/proj4.js',
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,13 @@ function Point(x, y, z) {
  this.clone = function() {
    return new Point(this.x, this.y, this.z);
  };
  this.toArray = function(){
    if(this.z){
      return [this.x,this.y, this.z];
    }else{
      return [this.x,this.y];
    }
  };
  this.toString = function() {
    return ("x=" + this.x + ",y=" + this.y);
  };
+8 −8
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@ var projections = require('./projections/index');
var wkt = require('./wkt');
var projStr = require('./projString');

function proj(srsCode) {
  if (!(this instanceof proj)) {
    return new proj(srsCode);
function Projection(srsCode) {
  if (!(this instanceof Projection)) {
    return new Projection(srsCode);
  }
  this.srsCodeInput = srsCode;
  this.x0 = 0;
@@ -40,16 +40,16 @@ function proj(srsCode) {

  this.initTransforms(this.projName);
}
proj.projections = projections;
proj.projections.start();
proj.prototype = {
Projection.projections = projections;
Projection.projections.start();
Projection.prototype = {
  /**
   * Function: initTransforms
   *    Finalize the initialization of the Proj object
   *
   */
  initTransforms: function(projName) {
    var ourProj = proj.projections.get(projName);
    var ourProj = Projection.projections.get(projName);
    if (ourProj) {
      extend(this, ourProj);
      this.init();
@@ -130,4 +130,4 @@ proj.prototype = {
    self.datum = datum(self);
  }
};
module.exports = proj;
module.exports = Projection;
+3 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ function checkProj(item) {
  }
  return proj(item);
}
module.exports = function(fromProj, toProj, coord) {
function proj4(fromProj, toProj, coord) {
  fromProj = checkProj(fromProj);
  var single = false;
  var obj;
@@ -61,4 +61,5 @@ module.exports = function(fromProj, toProj, coord) {
    }
    return obj;
  }
};
 No newline at end of file
}
module.exports = proj4;
 No newline at end of file