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:
@@ -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