Comparing version 2.12.0 to 2.12.1
{ | ||
"name": "proj4", | ||
"version": "2.12.0", | ||
"version": "2.12.1", | ||
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/proj4js/proj4js", |
{ | ||
"name": "proj4", | ||
"version": "2.12.0", | ||
"version": "2.12.1", | ||
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", | ||
@@ -5,0 +5,0 @@ "repo": "proj4js/proj4js", |
@@ -12,8 +12,8 @@ import proj from './Proj'; | ||
if (typeof transformedArray.z === 'number') { | ||
return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3)); | ||
return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.slice(3)); | ||
} else { | ||
return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3)); | ||
return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.slice(3)); | ||
} | ||
} else { | ||
return [transformedArray.x, transformedArray.y].concat(coords.splice(2)); | ||
return [transformedArray.x, transformedArray.y].concat(coords.slice(2)); | ||
} | ||
@@ -20,0 +20,0 @@ } else { |
{ | ||
"name": "proj4", | ||
"version": "2.12.0", | ||
"version": "2.12.1", | ||
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://proj4js.github.io/proj4js/", |
@@ -154,6 +154,15 @@ // You can do this in the grunt config for each mocha task, see the `options` config | ||
it('should work with a 2 element array', function() { | ||
var xy = proj4(new proj4.Proj(testPoint.code), testPoint.ll); | ||
const ll = [testPoint.ll[0], testPoint.ll[1]]; | ||
Object.freeze(ll); | ||
var xy = proj4(new proj4.Proj(testPoint.code), ll); | ||
assert.closeTo(xy[0], testPoint.xy[0], xyEPSLN, 'x is close'); | ||
assert.closeTo(xy[1], testPoint.xy[1], xyEPSLN, 'y is close'); | ||
}); | ||
it('should work wit a 3 element array', function() { | ||
const llz = [testPoint.ll[0], testPoint.ll[1], 0]; | ||
Object.freeze(llz); | ||
var xy = proj4(new proj4.Proj(testPoint.code), llz); | ||
assert.closeTo(xy[0], testPoint.xy[0], xyEPSLN, 'x is close'); | ||
assert.closeTo(xy[1], testPoint.xy[1], xyEPSLN, 'y is close'); | ||
}); | ||
it('should work on element', function() { | ||
@@ -160,0 +169,0 @@ var xy = proj4(new proj4.Proj(testPoint.code)).forward(testPoint.ll); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
955609
14588