Check projections equivalence also by their code

Method ol.proj.equivalent used only reference equality check ===
That doesn't work for basic checks of two strongly equal projections
For example, `EPSG:4326` and `EPSG:4326`
In this case method searches similar proj in ol.proj.transforms_ mapping
And it finds it if proj is default and not custom
But in case of custom proj `EPSG:3413` it doesn't find it
This commit is contained in:
nd0ut
2015-04-17 14:36:37 +03:00
parent b039a7528c
commit 12e817e408
2 changed files with 23 additions and 0 deletions

View File

@@ -30,6 +30,27 @@ describe('ol.proj', function() {
]);
});
it('gives that custom 3413 is equivalent to self', function() {
var code = 'EPSG:3413';
var source = new ol.proj.Projection({
code: code
});
var destination = new ol.proj.Projection({
code: code
});
expect(ol.proj.equivalent(source, destination)).to.be.ok();
});
it('gives that default 3857 is equivalent to self', function() {
_testAllEquivalent([
'EPSG:3857',
'EPSG:3857'
]);
});
it('gives that CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:4326 are ' +
'equivalent', function() {
_testAllEquivalent([