diff --git a/src/ol/projection.exports b/src/ol/projection.exports index e82e78498f..cf864fd43f 100644 --- a/src/ol/projection.exports +++ b/src/ol/projection.exports @@ -4,6 +4,8 @@ @exportProperty ol.Projection.prototype.getExtent @exportProperty ol.Projection.prototype.getPointResolution @exportProperty ol.Projection.prototype.getUnits +@exportProperty ol.Projection.prototype.getMetersPerUnit +@exportProperty ol.Projection.prototype.isGlobal @exportSymbol ol.ProjectionUnits @exportProperty ol.ProjectionUnits.DEGREES diff --git a/src/ol/projection.js b/src/ol/projection.js index 4080127ad5..c3558ee557 100644 --- a/src/ol/projection.js +++ b/src/ol/projection.js @@ -50,8 +50,10 @@ ol.METERS_PER_UNIT[ol.ProjectionUnits.METERS] = 1; * @param {ol.ProjectionUnits} units Units. * @param {ol.Extent} extent Extent. * @param {string=} opt_axisOrientation Axis orientation. + * @param {boolean=} opt_global Wether the projection is global. */ -ol.Projection = function(code, units, extent, opt_axisOrientation) { +ol.Projection = + function(code, units, extent, opt_axisOrientation, opt_global) { /** * @private @@ -78,6 +80,13 @@ ol.Projection = function(code, units, extent, opt_axisOrientation) { this.axisOrientation_ = goog.isDef(opt_axisOrientation) ? opt_axisOrientation : 'enu'; + /** + * @private + * @type {string} + */ + this.global_ = goog.isDef(opt_global) ? + opt_global : false; + /** * @private * @type {ol.tilegrid.TileGrid} @@ -143,6 +152,14 @@ ol.Projection.prototype.getAxisOrientation = function() { }; +/** + * @return {boolean} Wether the projection is global. + */ +ol.Projection.prototype.isGlobal = function() { + return this.global_; +}; + + /** * @return {ol.tilegrid.TileGrid} The default tile grid. */