Cope with axis orientation for tiled WMS sources

This commit is contained in:
Tom Payne
2013-02-21 20:22:28 +01:00
parent 6b26cbfb38
commit 66e5b1d736
3 changed files with 24 additions and 9 deletions

View File

@@ -69,14 +69,25 @@ describe('ol.TileUrlFunction', function() {
});
});
it('creates expected URL', function() {
var epsg3857 = ol.Projection.getFromCode('EPSG:3857');
var tileUrlFunction = ol.TileUrlFunction.createBboxParam(
'http://wms?foo=bar', tileGrid);
'http://wms?foo=bar', tileGrid, epsg3857.getAxisOrientation());
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';
expect(tileUrl).toEqual(expected);
});
it('creates expected URL respecting axis orientation', function() {
var epsg4326 = ol.Projection.getFromCode('EPSG:4326');
var tileUrlFunction = ol.TileUrlFunction.createBboxParam(
'http://wms?foo=bar', tileGrid, epsg4326.getAxisOrientation());
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';
expect(tileUrl).toEqual(expected);
});
});
});