Loading proj4/Proj.js +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ define(function(require) { return new proj(srsCode); } this.srsCodeInput = srsCode; this.x0 = 0; this.y0 = 0; var obj; if(typeof srsCode === 'string'){ //check to see if this is a WKT string Loading proj4/projString.js +7 −3 Original line number Diff line number Diff line Loading @@ -11,9 +11,6 @@ define(function(require) { return a; }).forEach(function(a) { var split = a.split("="); if (split[1] === "@null") { return; } split.push(true); paramObj[split[0].toLowerCase()] = split[1]; }); Loading Loading @@ -86,6 +83,13 @@ define(function(require) { pm: function(v) { self.from_greenwich = (constants.PrimeMeridian[v] ? constants.PrimeMeridian[v] : parseFloat(v, 10)) * common.D2R; }, nadgrids: function(v) { if (v==='@null') { self.datumCode = 'none'; } else { self.nadgrids = v; } }, axis: function(v) { var legalAxis = "ewnsud"; if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) { Loading test/test.js +3 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ function startTests( chai, proj4) { }); var assert = chai.assert; proj4.defs([ ["EPSG:102018", "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"]//, ["EPSG:102018", "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"], ["testmerc", "+proj=merc +lon_0=5.937 +lat_ts=45.027 +ellps=sphere +datum=none"], ["testmerc2", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs"] ]); proj4.defs('esriOnline','PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]'); Loading test/testData.js +8 −0 Original line number Diff line number Diff line var testPoints = [ {code: 'testmerc', xy: [-45007.0787624, 4151725.59875], ll: [5.364315,46.623154] }, {code: 'testmerc2', xy: [4156404,7480076.5], ll: [37.33761240175515, 55.60447049026976] }, {code: 'PROJCS["CH1903 / LV03",GEOGCS["CH1903",DATUM["D_CH1903",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],PARAMETER["latitude_of_center",46.95240555555556],PARAMETER["longitude_of_center",7.439583333333333],PARAMETER["azimuth",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["Meter",1]]', xy: [660389.4751110513, 185731.68482649108], ll: [8.23, 46.82], Loading Loading
proj4/Proj.js +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ define(function(require) { return new proj(srsCode); } this.srsCodeInput = srsCode; this.x0 = 0; this.y0 = 0; var obj; if(typeof srsCode === 'string'){ //check to see if this is a WKT string Loading
proj4/projString.js +7 −3 Original line number Diff line number Diff line Loading @@ -11,9 +11,6 @@ define(function(require) { return a; }).forEach(function(a) { var split = a.split("="); if (split[1] === "@null") { return; } split.push(true); paramObj[split[0].toLowerCase()] = split[1]; }); Loading Loading @@ -86,6 +83,13 @@ define(function(require) { pm: function(v) { self.from_greenwich = (constants.PrimeMeridian[v] ? constants.PrimeMeridian[v] : parseFloat(v, 10)) * common.D2R; }, nadgrids: function(v) { if (v==='@null') { self.datumCode = 'none'; } else { self.nadgrids = v; } }, axis: function(v) { var legalAxis = "ewnsud"; if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) { Loading
test/test.js +3 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ function startTests( chai, proj4) { }); var assert = chai.assert; proj4.defs([ ["EPSG:102018", "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"]//, ["EPSG:102018", "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"], ["testmerc", "+proj=merc +lon_0=5.937 +lat_ts=45.027 +ellps=sphere +datum=none"], ["testmerc2", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs"] ]); proj4.defs('esriOnline','PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]'); Loading
test/testData.js +8 −0 Original line number Diff line number Diff line var testPoints = [ {code: 'testmerc', xy: [-45007.0787624, 4151725.59875], ll: [5.364315,46.623154] }, {code: 'testmerc2', xy: [4156404,7480076.5], ll: [37.33761240175515, 55.60447049026976] }, {code: 'PROJCS["CH1903 / LV03",GEOGCS["CH1903",DATUM["D_CH1903",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],PARAMETER["latitude_of_center",46.95240555555556],PARAMETER["longitude_of_center",7.439583333333333],PARAMETER["azimuth",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["Meter",1]]', xy: [660389.4751110513, 185731.68482649108], ll: [8.23, 46.82], Loading