Do not overwrite projections in the registry

This commit is contained in:
Andreas Hocevar
2015-08-19 13:06:23 +02:00
parent 33da0e7b66
commit a8797ae1ff
2 changed files with 14 additions and 3 deletions

View File

@@ -141,8 +141,10 @@ ol.proj.Projection = function(options) {
*/
this.defaultTileGrid_ = null;
if (ol.ENABLE_PROJ4JS && typeof proj4 == 'function') {
var code = options.code;
var projections = ol.proj.projections_;
var code = options.code;
if (ol.ENABLE_PROJ4JS && typeof proj4 == 'function' &&
!goog.isDef(projections[code])) {
var def = proj4.defs(code);
if (goog.isDef(def)) {
if (goog.isDef(def.axis) && !goog.isDef(options.axisOrientation)) {
@@ -158,7 +160,6 @@ ol.proj.Projection = function(options) {
}
this.units_ = units;
}
var projections = ol.proj.projections_;
var currentCode, currentDef, currentProj, proj4Transform;
for (currentCode in projections) {
currentDef = proj4.defs(currentCode);