Redefine ol.Size to be Array.<number>
This commit is contained in:
@@ -56,7 +56,7 @@ describe('ol.extent', function() {
|
||||
|
||||
it('works for a unit square', function() {
|
||||
var extent = ol.extent.getForView2DAndSize(
|
||||
[0, 0], 1, 0, new ol.Size(1, 1));
|
||||
[0, 0], 1, 0, [1, 1]);
|
||||
expect(extent[0]).to.be(-0.5);
|
||||
expect(extent[1]).to.be(0.5);
|
||||
expect(extent[2]).to.be(-0.5);
|
||||
@@ -65,7 +65,7 @@ describe('ol.extent', function() {
|
||||
|
||||
it('works for center', function() {
|
||||
var extent = ol.extent.getForView2DAndSize(
|
||||
[5, 10], 1, 0, new ol.Size(1, 1));
|
||||
[5, 10], 1, 0, [1, 1]);
|
||||
expect(extent[0]).to.be(4.5);
|
||||
expect(extent[1]).to.be(5.5);
|
||||
expect(extent[2]).to.be(9.5);
|
||||
@@ -74,7 +74,7 @@ describe('ol.extent', function() {
|
||||
|
||||
it('works for rotation', function() {
|
||||
var extent = ol.extent.getForView2DAndSize(
|
||||
[0, 0], 1, Math.PI / 4, new ol.Size(1, 1));
|
||||
[0, 0], 1, Math.PI / 4, [1, 1]);
|
||||
expect(extent[0]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[1]).to.roughlyEqual(Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[2]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
@@ -83,7 +83,7 @@ describe('ol.extent', function() {
|
||||
|
||||
it('works for resolution', function() {
|
||||
var extent = ol.extent.getForView2DAndSize(
|
||||
[0, 0], 2, 0, new ol.Size(1, 1));
|
||||
[0, 0], 2, 0, [1, 1]);
|
||||
expect(extent[0]).to.be(-1);
|
||||
expect(extent[1]).to.be(1);
|
||||
expect(extent[2]).to.be(-1);
|
||||
@@ -92,7 +92,7 @@ describe('ol.extent', function() {
|
||||
|
||||
it('works for size', function() {
|
||||
var extent = ol.extent.getForView2DAndSize(
|
||||
[0, 0], 1, 0, new ol.Size(10, 5));
|
||||
[0, 0], 1, 0, [10, 5]);
|
||||
expect(extent[0]).to.be(-5);
|
||||
expect(extent[1]).to.be(5);
|
||||
expect(extent[2]).to.be(-2.5);
|
||||
@@ -105,8 +105,7 @@ describe('ol.extent', function() {
|
||||
it('returns the expected size', function() {
|
||||
var extent = [0, 2, 1, 4];
|
||||
var size = ol.extent.getSize(extent);
|
||||
expect(size.width).to.eql(2);
|
||||
expect(size.height).to.eql(3);
|
||||
expect(size).to.eql([2, 3]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -238,6 +237,5 @@ describe('ol.extent', function() {
|
||||
});
|
||||
|
||||
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.proj');
|
||||
|
||||
@@ -197,7 +197,7 @@ ol.test.source.MockTileSource = function(loaded) {
|
||||
resolutions: [360 / 256, 180 / 256, 90 / 256, 45 / 256],
|
||||
extent: extent,
|
||||
origin: [-180, -180],
|
||||
tileSize: new ol.Size(256, 256)
|
||||
tileSize: [256, 256]
|
||||
});
|
||||
|
||||
goog.base(this, {
|
||||
@@ -265,7 +265,6 @@ describe('ol.test.source.MockTileSource', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.object');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileState');
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('ol.source.wms', function() {
|
||||
'foo=bar&STYLES=&CRS=EPSG%3A3857&BBOX=' +
|
||||
'-20037508.342789244%2C-20037508.342789244%2C0%2C0';
|
||||
var url = ol.source.wms.getUrl('http://wms', {'foo': 'bar'},
|
||||
extent, new ol.Size(256, 256), epsg3857);
|
||||
extent, [256, 256], epsg3857);
|
||||
expect(url).to.eql(expected);
|
||||
});
|
||||
it('creates expected URL respecting axis orientation', function() {
|
||||
@@ -21,7 +21,7 @@ describe('ol.source.wms', function() {
|
||||
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
|
||||
'foo=bar&STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';
|
||||
var url = ol.source.wms.getUrl('http://wms', {'foo': 'bar'},
|
||||
extent, new ol.Size(256, 256), epsg4326);
|
||||
extent, [256, 256], epsg4326);
|
||||
expect(url).to.eql(expected);
|
||||
});
|
||||
});
|
||||
@@ -29,6 +29,5 @@ describe('ol.source.wms', function() {
|
||||
});
|
||||
|
||||
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.wms');
|
||||
|
||||
@@ -12,7 +12,7 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
extent = [0, 100000, 0, 100000];
|
||||
origin = [0, 0];
|
||||
origins = [];
|
||||
tileSize = new ol.Size(100, 100);
|
||||
tileSize = [100, 100];
|
||||
});
|
||||
|
||||
describe('create valid', function() {
|
||||
@@ -201,7 +201,7 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
|
||||
var resolutions = grid.getResolutions();
|
||||
expect(resolutions.length).to.be(ol.DEFAULT_MAX_ZOOM + 1);
|
||||
expect(grid.getTileSize().toString()).to.be('(256 x 256)');
|
||||
expect(grid.getTileSize()).to.eql([256, 256]);
|
||||
});
|
||||
|
||||
it('stores the default tile grid on a projection', function() {
|
||||
@@ -285,7 +285,7 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
|
||||
describe('getTileCoordForCoordAndResolution', function() {
|
||||
it('returns the expected TileCoord', function() {
|
||||
var tileSize = new ol.Size(256, 256);
|
||||
var tileSize = [256, 256];
|
||||
var tileGrid = new ol.tilegrid.TileGrid({
|
||||
resolutions: [10],
|
||||
extent: extent,
|
||||
@@ -633,7 +633,6 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
});
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.tilegrid.TileGrid');
|
||||
|
||||
@@ -102,8 +102,7 @@ describe('ol.TileRange', function() {
|
||||
it('returns the expected size', function() {
|
||||
var tileRange = new ol.TileRange(0, 2, 1, 4);
|
||||
var size = tileRange.getSize();
|
||||
expect(size.width).to.eql(3);
|
||||
expect(size.height).to.eql(4);
|
||||
expect(size).to.eql([3, 4]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -91,14 +91,13 @@ describe('ol.TileUrlFunction', function() {
|
||||
expect(args[0]).to.eql('url');
|
||||
expect(args[1]).to.be(params);
|
||||
expect(args[2]).to.eql(projection.getExtent());
|
||||
expect(args[3]).to.eql(new ol.Size(256, 256));
|
||||
expect(args[3]).to.eql([256, 256]);
|
||||
expect(args[4]).to.eql(projection);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.proj');
|
||||
|
||||
Reference in New Issue
Block a user