Allowing people to set up things backwards.
This commit is contained in:
@@ -70,6 +70,18 @@ ol.layer.TileLayer = function() {
|
|||||||
*/
|
*/
|
||||||
this.maxResolution_ = undefined;
|
this.maxResolution_ = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.xRight_ = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.yDown_ = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
@@ -92,6 +104,33 @@ ol.layer.TileLayer = function() {
|
|||||||
|
|
||||||
goog.inherits(ol.layer.TileLayer, ol.layer.Layer);
|
goog.inherits(ol.layer.TileLayer, ol.layer.Layer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} The tile index increases from left to right.
|
||||||
|
*/
|
||||||
|
ol.layer.TileLayer.prototype.getXRight = function() {
|
||||||
|
return this.xRight_;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} The tile index increases from top to bottom.
|
||||||
|
*/
|
||||||
|
ol.layer.TileLayer.prototype.getYDown = function() {
|
||||||
|
return this.yDown_;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {boolean} right The tile index increases from left to right.
|
||||||
|
*/
|
||||||
|
ol.layer.TileLayer.prototype.setXRight = function(right) {
|
||||||
|
this.xRight_ = right;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {boolean} down The tile index increases from top to bottom.
|
||||||
|
*/
|
||||||
|
ol.layer.TileLayer.prototype.setYDown = function(down) {
|
||||||
|
this.yDown_ = down;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get layer extent. Return null if the layer has no extent
|
* Get layer extent. Return null if the layer has no extent
|
||||||
|
|||||||
@@ -22,6 +22,26 @@ describe('ol.layer.TileLayer', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('axis orientation', function() {
|
||||||
|
var layer = new ol.layer.TileLayer();
|
||||||
|
|
||||||
|
it('increases from left to right by default', function() {
|
||||||
|
expect(layer.getXRight()).toBe(true);
|
||||||
|
});
|
||||||
|
it('increases from top to bottom by default', function() {
|
||||||
|
expect(layer.getYDown()).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('allows people to set things backwards', function() {
|
||||||
|
var backwards = new ol.layer.TileLayer();
|
||||||
|
backwards.setXRight(false);
|
||||||
|
expect(backwards.getXRight()).toBe(false);
|
||||||
|
backwards.setYDown(false);
|
||||||
|
expect(backwards.getYDown()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
describe('get tile origin', function() {
|
describe('get tile origin', function() {
|
||||||
var layer;
|
var layer;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user