Merge pull request #3575 from nd0ut/master
Check proj equivalence by code.
This commit is contained in:
@@ -656,6 +656,8 @@ ol.proj.get = function(projectionLike) {
|
||||
ol.proj.equivalent = function(projection1, projection2) {
|
||||
if (projection1 === projection2) {
|
||||
return true;
|
||||
} else if (projection1.getCode() === projection2.getCode()) {
|
||||
return true;
|
||||
} else if (projection1.getUnits() != projection2.getUnits()) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user