Merge branch 'master' of github.com:openlayers/ol3 into vector
This commit is contained in:
@@ -71,3 +71,5 @@ describe('ol.Color', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.Color');
|
||||
|
||||
@@ -388,4 +388,5 @@ describe('ol.Ellipsoid', function() {
|
||||
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Ellipsoid');
|
||||
goog.require('ol.ellipsoid.WGS84');
|
||||
|
||||
@@ -52,17 +52,17 @@ describe('ol.Extent', function() {
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(3, 1))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(3, 5))).toBeFalsy();
|
||||
new ol.Coordinate(3, 5))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(4, 1))).toBeFalsy();
|
||||
new ol.Coordinate(4, 1))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(4, 2))).toBeFalsy();
|
||||
new ol.Coordinate(4, 2))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(4, 3))).toBeFalsy();
|
||||
new ol.Coordinate(4, 3))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(4, 4))).toBeFalsy();
|
||||
new ol.Coordinate(4, 4))).toBeFalsy();
|
||||
expect(extent.containsCoordinate(
|
||||
new ol.Coordinate(4, 5))).toBeFalsy();
|
||||
new ol.Coordinate(4, 5))).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -84,8 +84,8 @@ describe('ol.Extent', function() {
|
||||
});
|
||||
|
||||
it('takes arbitrary function', function() {
|
||||
var transformFn = function(coordinate) {
|
||||
return new ol.Coordinate(-coordinate.x, -coordinate.y);
|
||||
var transformFn = function(input) {
|
||||
return [-input[0], -input[1], -input[2], -input[3]];
|
||||
};
|
||||
var sourceExtent = new ol.Extent(-15, -30, 45, 60);
|
||||
var destinationExtent = sourceExtent.transform(transformFn);
|
||||
@@ -100,5 +100,6 @@ describe('ol.Extent', function() {
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.projection');
|
||||
|
||||
@@ -276,4 +276,6 @@ describe('ol.layer.Layer', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.source.Source');
|
||||
|
||||
@@ -187,3 +187,5 @@ describe('ol.structs.LRUCache', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.structs.LRUCache');
|
||||
|
||||
@@ -79,7 +79,8 @@ describe('ol.Map', function() {
|
||||
mouseWheelZoom: false,
|
||||
shiftDragZoom: false,
|
||||
touchPan: false,
|
||||
touchRotateZoom: false
|
||||
touchRotate: false,
|
||||
touchZoom: false
|
||||
};
|
||||
});
|
||||
|
||||
@@ -245,6 +246,9 @@ goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction.DblClickZoom');
|
||||
goog.require('ol.interaction.MouseWheelZoom');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
@@ -105,26 +105,24 @@ describe('ol.parser.ogc.wmtscapabilities_v1_0_0', function() {
|
||||
expect(wgs84Bbox.maxX).toEqual(180.0);
|
||||
expect(wgs84Bbox.minY).toEqual(-90.0);
|
||||
expect(wgs84Bbox.maxY).toEqual(90.0);
|
||||
expect(layer.resourceUrl.tile.format).toEqual('image/png');
|
||||
var tpl = 'http://www.example.com/wmts/coastlines/{TileMatrix}/' +
|
||||
'{TileRow}/{TileCol}.png';
|
||||
expect(layer.resourceUrl.tile.template).toEqual(tpl);
|
||||
var format = 'application/gml+xml; version=3.1';
|
||||
expect(layer.resourceUrl.FeatureInfo.format).toEqual(format);
|
||||
tpl = 'http://www.example.com/wmts/coastlines/{TileMatrixSet}/' +
|
||||
'{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml';
|
||||
expect(layer.resourceUrl.FeatureInfo.template).toEqual(tpl);
|
||||
expect(layer.resourceUrls[0].format).toEqual('image/png');
|
||||
expect(layer.resourceUrls[0].resourceType).toEqual('tile');
|
||||
tpl = 'http://www.example.com/wmts/coastlines/{TileMatrix}/' +
|
||||
expect(layer.resourceUrls.hasOwnProperty('tile')).toBeTruthy();
|
||||
var format = 'image/png';
|
||||
expect(layer.resourceUrls.tile.hasOwnProperty(format)).toBeTruthy();
|
||||
expect(layer.resourceUrls.tile[format].length).toEqual(2);
|
||||
var tpl = 'http://a.example.com/wmts/coastlines/{TileMatrix}/' +
|
||||
'{TileRow}/{TileCol}.png';
|
||||
expect(layer.resourceUrls[0].template).toEqual(tpl);
|
||||
expect(layer.resourceUrls.tile[format][0]).toEqual(tpl);
|
||||
tpl = 'http://b.example.com/wmts/coastlines/{TileMatrix}/' +
|
||||
'{TileRow}/{TileCol}.png';
|
||||
expect(layer.resourceUrls.tile[format][1]).toEqual(tpl);
|
||||
expect(layer.resourceUrls.hasOwnProperty('FeatureInfo')).toBeTruthy();
|
||||
format = 'application/gml+xml; version=3.1';
|
||||
expect(layer.resourceUrls[1].format).toEqual(format);
|
||||
expect(layer.resourceUrls[1].resourceType).toEqual('FeatureInfo');
|
||||
expect(layer.resourceUrls.FeatureInfo.hasOwnProperty(format))
|
||||
.toBeTruthy();
|
||||
expect(layer.resourceUrls.FeatureInfo[format].length).toEqual(1);
|
||||
tpl = 'http://www.example.com/wmts/coastlines/{TileMatrixSet}/' +
|
||||
'{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml';
|
||||
expect(layer.resourceUrls[1].template).toEqual(tpl);
|
||||
expect(layer.resourceUrls.FeatureInfo[format][0]).toEqual(tpl);
|
||||
expect(dimensions.length).toEqual(1);
|
||||
expect(dimensions[0].title).toEqual('Time');
|
||||
expect(dimensions[0]['abstract']).toEqual('Monthly datasets');
|
||||
@@ -180,4 +178,5 @@ describe('ol.parser.ogc.wmtscapabilities_v1_0_0', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.parser.ogc.WMTSCapabilities');
|
||||
|
||||
@@ -74,7 +74,9 @@
|
||||
</ows:WGS84BoundingBox>
|
||||
<ows:Identifier>coastlines</ows:Identifier>
|
||||
<ResourceURL format="image/png" resourceType="tile"
|
||||
template="http://www.example.com/wmts/coastlines/{TileMatrix}/{TileRow}/{TileCol}.png" />
|
||||
template="http://a.example.com/wmts/coastlines/{TileMatrix}/{TileRow}/{TileCol}.png" />
|
||||
<ResourceURL format="image/png" resourceType="tile"
|
||||
template="http://b.example.com/wmts/coastlines/{TileMatrix}/{TileRow}/{TileCol}.png" />
|
||||
<ResourceURL format="application/gml+xml; version=3.1" resourceType="FeatureInfo"
|
||||
template="http://www.example.com/wmts/coastlines/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml" />
|
||||
<Style isDefault="true">
|
||||
|
||||
50
test/spec/ol/projection.epsg3857.test.js
Normal file
50
test/spec/ol/projection.epsg3857.test.js
Normal file
@@ -0,0 +1,50 @@
|
||||
goog.provide('ol.test.projection.EPSG3857');
|
||||
|
||||
|
||||
describe('ol.projection.EPSG3857', function() {
|
||||
|
||||
describe('getPointResolution', function() {
|
||||
|
||||
it('returns the correct point scale at the equator', function() {
|
||||
// @see http://msdn.microsoft.com/en-us/library/aa940990.aspx
|
||||
var epsg3857 = ol.projection.getFromCode('EPSG:3857');
|
||||
var resolution = 19.11;
|
||||
var point = new ol.Coordinate(0, 0);
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
toRoughlyEqual(19.11, 1e-1);
|
||||
});
|
||||
|
||||
it('returns the correct point scale at the latitude of Toronto',
|
||||
function() {
|
||||
// @see http://msdn.microsoft.com/en-us/library/aa940990.aspx
|
||||
var epsg3857 = ol.projection.getFromCode('EPSG:3857');
|
||||
var epsg4326 = ol.projection.getFromCode('EPSG:4326');
|
||||
var resolution = 19.11;
|
||||
var point = ol.projection.transform(
|
||||
new ol.Coordinate(0, 43.65), epsg4326, epsg3857);
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
toRoughlyEqual(19.11 * Math.cos(Math.PI * 43.65 / 180), 1e-9);
|
||||
});
|
||||
|
||||
it('returns the correct point scale at various latitudes', function() {
|
||||
// @see http://msdn.microsoft.com/en-us/library/aa940990.aspx
|
||||
var epsg3857 = ol.projection.getFromCode('EPSG:3857');
|
||||
var epsg4326 = ol.projection.getFromCode('EPSG:4326');
|
||||
var resolution = 19.11;
|
||||
var latitude;
|
||||
for (latitude = 0; latitude < 90; ++latitude) {
|
||||
var point = ol.projection.transform(
|
||||
new ol.Coordinate(0, latitude), epsg4326, epsg3857);
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
toRoughlyEqual(19.11 * Math.cos(Math.PI * latitude / 180), 1e-9);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.projection.EPSG3857');
|
||||
@@ -144,6 +144,36 @@ describe('ol.projection', function() {
|
||||
expect(point.y).toRoughlyEqual(200146.976, 1);
|
||||
});
|
||||
|
||||
it('numerically estimates point scale at the equator', function() {
|
||||
var googleProjection = ol.projection.getFromCode('GOOGLE');
|
||||
expect(googleProjection.getPointResolution(1, new ol.Coordinate(0, 0))).
|
||||
toRoughlyEqual(1, 1e-1);
|
||||
});
|
||||
|
||||
it('numerically estimates point scale at various latitudes', function() {
|
||||
var epsg3857Projection = ol.projection.getFromCode('EPSG:3857');
|
||||
var googleProjection = ol.projection.getFromCode('GOOGLE');
|
||||
var point, y;
|
||||
for (y = -20; y <= 20; ++y) {
|
||||
point = new ol.Coordinate(0, 1000000 * y);
|
||||
expect(googleProjection.getPointResolution(1, point)).toRoughlyEqual(
|
||||
epsg3857Projection.getPointResolution(1, point), 1e-1);
|
||||
}
|
||||
});
|
||||
|
||||
it('numerically estimates point scale at various points', function() {
|
||||
var epsg3857Projection = ol.projection.getFromCode('EPSG:3857');
|
||||
var googleProjection = ol.projection.getFromCode('GOOGLE');
|
||||
var point, x, y;
|
||||
for (x = -20; x <= 20; ++x) {
|
||||
for (y = -20; y <= 20; ++y) {
|
||||
point = new ol.Coordinate(1000000 * x, 1000000 * y);
|
||||
expect(googleProjection.getPointResolution(1, point)).toRoughlyEqual(
|
||||
epsg3857Projection.getPointResolution(1, point), 1e-1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('ol.projection.getTransform()', function() {
|
||||
@@ -155,10 +185,22 @@ describe('ol.projection', function() {
|
||||
var transform = ol.projection.getTransform(sm, gg);
|
||||
expect(typeof transform).toBe('function');
|
||||
|
||||
var coordinate = transform(new ol.Coordinate(-12000000, 5000000));
|
||||
var output = transform([-12000000, 5000000]);
|
||||
|
||||
expect(coordinate.x).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(coordinate.y).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
expect(output[0]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
});
|
||||
|
||||
it('works for longer arrays', function() {
|
||||
var transform = ol.projection.getTransform(sm, gg);
|
||||
expect(typeof transform).toBe('function');
|
||||
|
||||
var output = transform([-12000000, 5000000, -12000000, 5000000]);
|
||||
|
||||
expect(output[0]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
expect(output[2]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[3]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -177,14 +219,69 @@ describe('ol.projection', function() {
|
||||
'GOOGLE', 'EPSG:4326');
|
||||
expect(typeof transform).toBe('function');
|
||||
|
||||
var coordinate = transform(
|
||||
new ol.Coordinate(-626172.13571216376, 6887893.4928337997));
|
||||
var output = transform([-626172.13571216376, 6887893.4928337997]);
|
||||
|
||||
expect(coordinate.x).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(coordinate.y).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
expect(output[0]).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
|
||||
});
|
||||
|
||||
it('works for longer arrays of coordinate values', function() {
|
||||
var transform = ol.projection.getTransformFromCodes(
|
||||
'GOOGLE', 'EPSG:4326');
|
||||
expect(typeof transform).toBe('function');
|
||||
|
||||
var output = transform([
|
||||
-626172.13571216376, 6887893.4928337997,
|
||||
-12000000, 5000000,
|
||||
-626172.13571216376, 6887893.4928337997
|
||||
]);
|
||||
|
||||
expect(output[0]).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
expect(output[2]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[3]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
expect(output[4]).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(output[5]).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
});
|
||||
|
||||
it('accepts an optional destination array', function() {
|
||||
var transform = ol.projection.getTransformFromCodes(
|
||||
'EPSG:3857', 'EPSG:4326');
|
||||
var input = [-12000000, 5000000];
|
||||
var output = [];
|
||||
|
||||
var got = transform(input, output);
|
||||
expect(got).toBe(output);
|
||||
|
||||
expect(output[0]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
|
||||
expect(input).toEqual([-12000000, 5000000]);
|
||||
});
|
||||
|
||||
it('accepts a dimension', function() {
|
||||
var transform = ol.projection.getTransformFromCodes(
|
||||
'GOOGLE', 'EPSG:4326');
|
||||
expect(typeof transform).toBe('function');
|
||||
|
||||
var dimension = 3;
|
||||
var output = transform([
|
||||
-626172.13571216376, 6887893.4928337997, 100,
|
||||
-12000000, 5000000, 200,
|
||||
-626172.13571216376, 6887893.4928337997, 300
|
||||
], undefined, dimension);
|
||||
|
||||
expect(output[0]).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(output[1]).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
expect(output[2]).toBe(100);
|
||||
expect(output[3]).toRoughlyEqual(-107.79783409434258, 1e-9);
|
||||
expect(output[4]).toRoughlyEqual(40.91627447067577, 1e-9);
|
||||
expect(output[5]).toBe(200);
|
||||
expect(output[6]).toRoughlyEqual(-5.625, 1e-9);
|
||||
expect(output[7]).toRoughlyEqual(52.4827802220782, 1e-9);
|
||||
expect(output[8]).toBe(300);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ol.projection.removeTransform()', function() {
|
||||
@@ -195,7 +292,7 @@ describe('ol.projection', function() {
|
||||
it('removes functions cached by addTransform', function() {
|
||||
var foo = new ol.Projection('foo', units, extent);
|
||||
var bar = new ol.Projection('bar', units, extent);
|
||||
var transform = function() {};
|
||||
var transform = function(input, output, dimension) {return input};
|
||||
ol.projection.addTransform(foo, bar, transform);
|
||||
expect(ol.projection.transforms_).not.toBeUndefined();
|
||||
expect(ol.projection.transforms_.foo).not.toBeUndefined();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.test.renderer.webgl.ImageLayer');
|
||||
|
||||
describe('ol.renderer.webgl.ImageLayer', function() {
|
||||
describe('updateVertexCoordMatrix_', function() {
|
||||
describe('updateProjectionMatrix_', function() {
|
||||
var map;
|
||||
var renderer;
|
||||
var canvasWidth;
|
||||
@@ -41,9 +41,9 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
||||
|
||||
it('produces a correct matrix', function() {
|
||||
|
||||
renderer.updateVertexCoordMatrix_(canvasWidth, canvasHeight,
|
||||
renderer.updateProjectionMatrix_(canvasWidth, canvasHeight,
|
||||
viewCenter, viewResolution, viewRotation, imageExtent);
|
||||
var matrix = renderer.getVertexCoordMatrix();
|
||||
var matrix = renderer.getProjectionMatrix();
|
||||
|
||||
var input;
|
||||
var output = goog.vec.Vec4.createNumber();
|
||||
@@ -78,6 +78,7 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
||||
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('goog.vec.Vec4');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Image');
|
||||
goog.require('ol.Map');
|
||||
|
||||
@@ -227,12 +227,13 @@ describe('ol.test.source.MockTileSource', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.object');
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileState');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.source.Source');
|
||||
goog.require('ol.source.TileSource');
|
||||
goog.require('ol.tilegrid.TileGrid');
|
||||
|
||||
@@ -130,4 +130,5 @@ describe('ol.source.XYZ', function() {
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileUrlFunction');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
@@ -68,6 +68,20 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with both origin and multiple origins', function() {
|
||||
it('throws an exception', function() {
|
||||
expect(function() {
|
||||
return new ol.tilegrid.TileGrid({
|
||||
resolutions: [100, 50, 25, 10],
|
||||
extent: extent,
|
||||
origins: [origin, origin, origin, origin],
|
||||
origin: origin,
|
||||
tileSize: tileSize
|
||||
});
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with too few origins', function() {
|
||||
it('throws an exception', function() {
|
||||
expect(function() {
|
||||
@@ -94,6 +108,59 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with multiple tileSizes', function() {
|
||||
it('does not throw an exception', function() {
|
||||
expect(function() {
|
||||
return new ol.tilegrid.TileGrid({
|
||||
resolutions: [100, 50, 25, 10],
|
||||
extent: extent,
|
||||
tileSizes: [tileSize, tileSize, tileSize, tileSize],
|
||||
origin: origin
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with both tileSize and multiple tileSizes', function() {
|
||||
it('throws an exception', function() {
|
||||
expect(function() {
|
||||
return new ol.tilegrid.TileGrid({
|
||||
resolutions: [100, 50, 25, 10],
|
||||
extent: extent,
|
||||
tileSizes: [tileSize, tileSize, tileSize, tileSize],
|
||||
tileSize: tileSize,
|
||||
origin: origin
|
||||
});
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with too few tileSizes', function() {
|
||||
it('throws an exception', function() {
|
||||
expect(function() {
|
||||
return new ol.tilegrid.TileGrid({
|
||||
resolutions: [100, 50, 25, 10],
|
||||
extent: extent,
|
||||
tileSizes: [tileSize, tileSize, tileSize],
|
||||
origin: origin
|
||||
});
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('create with too many tileSizes', function() {
|
||||
it('throws an exception', function() {
|
||||
expect(function() {
|
||||
return new ol.tilegrid.TileGrid({
|
||||
resolutions: [100, 50, 25, 10],
|
||||
extent: extent,
|
||||
tileSizes: [tileSize, tileSize, tileSize, tileSize, tileSize],
|
||||
origin: origin
|
||||
});
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('createForProjection', function() {
|
||||
|
||||
it('allows easier creation of a tile grid', function() {
|
||||
|
||||
@@ -68,3 +68,6 @@ describe('ol.TileQueue', function() {
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileQueue');
|
||||
|
||||
@@ -131,4 +131,5 @@ describe('ol.TileRange', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.TileCoord');
|
||||
goog.require('ol.TileRange');
|
||||
|
||||
@@ -75,7 +75,8 @@ describe('ol.TileUrlFunction', function() {
|
||||
var tileCoord = new ol.TileCoord(1, 0, 0);
|
||||
var tileUrl = tileUrlFunction(tileCoord);
|
||||
var expected = 'http://wms?foo=bar&BBOX=-20037508.342789244' +
|
||||
'%2C20037508.342789244%2C0%2C40075016.68557849';
|
||||
'%2C20037508.342789244%2C0%2C40075016.68557849' +
|
||||
'&HEIGHT=256&WIDTH=256';
|
||||
expect(tileUrl).toEqual(expected);
|
||||
});
|
||||
it('creates expected URL respecting axis orientation', function() {
|
||||
@@ -85,7 +86,8 @@ describe('ol.TileUrlFunction', function() {
|
||||
var tileCoord = new ol.TileCoord(1, 0, 0);
|
||||
var tileUrl = tileUrlFunction(tileCoord);
|
||||
var expected = 'http://wms?foo=bar&BBOX=20037508.342789244' +
|
||||
'%2C-20037508.342789244%2C40075016.68557849%2C0';
|
||||
'%2C-20037508.342789244%2C40075016.68557849%2C0' +
|
||||
'&HEIGHT=256&WIDTH=256';
|
||||
expect(tileUrl).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user