From b6296a40b68777b29690ac08e17e150baa8ec7af Mon Sep 17 00:00:00 2001 From: Peter Robins Date: Tue, 19 Jun 2012 20:28:03 +0100 Subject: [PATCH] Change Projection so Proj4js no longer has to be global --- lib/OpenLayers/Projection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Projection.js b/lib/OpenLayers/Projection.js index 03d64e6935..8b45639696 100644 --- a/lib/OpenLayers/Projection.js +++ b/lib/OpenLayers/Projection.js @@ -62,7 +62,7 @@ OpenLayers.Projection = OpenLayers.Class({ initialize: function(projCode, options) { OpenLayers.Util.extend(this, options); this.projCode = projCode; - if (window.Proj4js) { + if (typeof Proj4js == "object") { this.proj = new Proj4js.Proj(projCode); } }, @@ -115,7 +115,7 @@ OpenLayers.Projection = OpenLayers.Class({ if (!(p instanceof OpenLayers.Projection)) { p = new OpenLayers.Projection(p); } - if (window.Proj4js && this.proj.defData && p.proj.defData) { + if ((typeof Proj4js == "object") && this.proj.defData && p.proj.defData) { equals = this.proj.defData.replace(this.titleRegEx, "") == p.proj.defData.replace(this.titleRegEx, ""); } else if (p.getCode) {