Dedicated module for proj4 access

This commit is contained in:
Tim Schaub
2016-12-04 10:37:33 -08:00
parent b54342dfb8
commit a33caa598c
2 changed files with 31 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
goog.provide('ol.proj.proj4');
/**
* @private
* @type {proj4}
*/
ol.proj.proj4.cache_ = null;
/**
* Store the proj4 function.
* @param {proj4} proj4 The proj4 function.
*/
ol.proj.proj4.set = function(proj4) {
ol.proj.proj4.cache_ = proj4;
};
/**
* Get proj4.
* @return {proj4} The proj4 function set above or available globally.
*/
ol.proj.proj4.get = function() {
return ol.proj.proj4.cache_ || window['proj4'];
};