Handle attribution visiblity for tile layers
This commit is contained in:
@@ -7,36 +7,25 @@ goog.require('ol.Extent');
|
||||
/**
|
||||
* @constructor
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {number} minZ Minimum Z.
|
||||
* @param {number} maxZ Maximum Z.
|
||||
*/
|
||||
ol.CoverageArea = function(extent, minZ, maxZ) {
|
||||
ol.CoverageArea = function(extent) {
|
||||
|
||||
/**
|
||||
* @type {ol.Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.minZ = minZ;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.maxZ = maxZ;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {number} z Z.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {boolean} Intersects.
|
||||
*/
|
||||
ol.CoverageArea.prototype.intersectsWithZ = function(extent, z) {
|
||||
return this.extent.intersects(extent) && this.minZ <= z && z <= this.maxZ;
|
||||
ol.CoverageArea.prototype.intersectsExtentAndResolution =
|
||||
function(extent, resolution) {
|
||||
return this.extent.intersects(extent);
|
||||
};
|
||||
|
||||
|
||||
@@ -46,5 +35,5 @@ ol.CoverageArea.prototype.intersectsWithZ = function(extent, z) {
|
||||
*/
|
||||
ol.CoverageArea.prototype.transform = function(transformFn) {
|
||||
var extent = this.extent.transform(transformFn);
|
||||
return new ol.CoverageArea(extent, this.minZ, this.maxZ);
|
||||
return new ol.CoverageArea(extent);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user