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

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