Add information on wether the projection is global

so that we know if we can wrap the dateline.
This commit is contained in:
Bruno Binet
2013-03-06 18:13:23 +01:00
parent a10cae6117
commit 8dd3093f4c
2 changed files with 20 additions and 1 deletions

View File

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

View File

@@ -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.
*/