Loading Gruntfile.js +3 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,9 @@ module.exports = function(grunt) { uglify: { options: { report: 'gzip', mangle: true mangle:{ except: ['proj4','Projection','Point'] }, }, all: { src: 'dist/proj4.js', Loading lib/Point.js +7 −0 Original line number Diff line number Diff line Loading @@ -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); }; Loading lib/Proj.js +8 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -130,4 +130,4 @@ proj.prototype = { self.datum = datum(self); } }; module.exports = proj; module.exports = Projection; lib/core.js +3 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading
Gruntfile.js +3 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,9 @@ module.exports = function(grunt) { uglify: { options: { report: 'gzip', mangle: true mangle:{ except: ['proj4','Projection','Point'] }, }, all: { src: 'dist/proj4.js', Loading
lib/Point.js +7 −0 Original line number Diff line number Diff line Loading @@ -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); }; Loading
lib/Proj.js +8 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -130,4 +130,4 @@ proj.prototype = { self.datum = datum(self); } }; module.exports = proj; module.exports = Projection;
lib/core.js +3 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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