Merge pull request #3523 from fredj/update-proj4js

Update proj4 version to 2.3.6
This commit is contained in:
Frédéric Junod
2015-04-15 09:11:59 +02:00
3 changed files with 28 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ docs: >
Example of a Sphere Mollweide map with a Graticule component.
tags: "graticule, Mollweide, projection, proj4js"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.1/proj4.js
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
---
<div class="row-fluid">
<div class="span12">

View File

@@ -55,7 +55,7 @@
"mocha": "1.21.5",
"mocha-phantomjs": "3.5.1",
"phantomjs": "1.9.10",
"proj4": "2.3.3",
"proj4": "2.3.6",
"resemblejs": "1.2.0",
"sinon": "1.10.3",
"slimerjs-edge": "0.10.0-pre-2"

View File

@@ -136,6 +136,32 @@ describe('ol.proj', function() {
describe('Proj4js integration', function() {
it('creates ol.proj.Projection instance from EPSG:21781', function() {
proj4.defs('EPSG:21781',
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 ' +
'+k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel ' +
'+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs');
var proj = ol.proj.get('EPSG:21781');
expect(proj.getCode()).to.eql('EPSG:21781');
expect(proj.getUnits()).to.eql('m');
expect(proj.getMetersPerUnit()).to.eql(1);
delete proj4.defs['EPSG:21781'];
});
it('creates ol.proj.Projection instance from EPSG:3739', function() {
proj4.defs('EPSG:3739',
'+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 ' +
'+x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 ' +
'+towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs');
var proj = ol.proj.get('EPSG:3739');
expect(proj.getCode()).to.eql('EPSG:3739');
expect(proj.getUnits()).to.eql('us-ft');
expect(proj.getMetersPerUnit()).to.eql(1200 / 3937);
delete proj4.defs['EPSG:3739'];
});
it('allows Proj4js projections to be used transparently', function() {
var point = ol.proj.transform(
[-626172.13571216376, 6887893.4928337997], 'GOOGLE', 'WGS84');