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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user