[ol.layer.TileLayer, ol.layer.XYZ] add a getMaxResolution func to TileLayer, and make ol.layer.XYZ be just a projection and a number of zoom levels

This commit is contained in:
Éric Lemoine
2012-06-22 11:49:31 +02:00
parent 1fcdffacc1
commit a0e5741774
3 changed files with 67 additions and 5 deletions

View File

@@ -134,6 +134,38 @@ describe('ol.layer.TileLayer', function() {
});
});
describe('get max resolution', function() {
var layer;
beforeEach(function() {
layer = new ol.layer.TileLayer();
});
describe('with max resolution', function() {
beforeEach(function() {
layer.setMaxResolution(156543.03390625);
});
it('returns the expected maxResolution', function() {
var maxResolution = layer.getMaxResolution();
expect(maxResolution).toEqual(156543.03390625);
});
});
describe('with projection', function() {
beforeEach(function() {
layer.setProjection(new ol.Projection("EPSG:3857"));
});
it('returns the expected maxResolution', function() {
var maxResolution = layer.getMaxResolution();
expect(maxResolution).toEqual(156543.03390625);
});
});
});
describe('get data from the layer', function() {
var layer;