Less context

This change removes all changes that were anticipated here for
WMS GetFeatureInfo handling, including the IWMS interface and
the goog.provide for 'ol.tilegrid'. I'll create a separate pull
request for WMS GetFeatureInfo eventually, taking into account
the suggestions from the discussion in #402.
This commit is contained in:
ahocevar
2013-03-20 13:41:36 +01:00
parent 57fdd78a19
commit 5719160155
15 changed files with 22 additions and 75 deletions

View File

@@ -3,17 +3,16 @@ goog.provide('ol.source.test.wms');
describe('ol.source.wms', function() {
describe('ol.source.wms.getUrl', function() {
var that = {params: {}};
it('creates expected URL', function() {
var epsg3857 = ol.projection.get('EPSG:3857');
var tileGrid = ol.tilegrid.getForProjection(epsg3857);
var tileUrlFunction = ol.TileUrlFunction.createFromParamsFunction(
'http://wms?foo=bar', ol.source.wms.getUrl);
'http://wms', {'foo': 'bar'}, ol.source.wms.getUrl);
var tileCoord = new ol.TileCoord(1, 0, 0);
var tileUrl = tileUrlFunction.call(that, tileCoord, tileGrid, epsg3857);
var expected = 'http://wms?foo=bar&SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
var tileUrl = tileUrlFunction(tileCoord, tileGrid, epsg3857);
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
'STYLES=&CRS=EPSG%3A3857&BBOX=' +
'foo=bar&STYLES=&CRS=EPSG%3A3857&BBOX=' +
'-20037508.342789244%2C-20037508.342789244%2C0%2C0';
expect(tileUrl).to.eql(expected);
});
@@ -21,12 +20,12 @@ describe('ol.source.wms', function() {
var epsg4326 = ol.projection.get('EPSG:4326');
var tileGrid = ol.tilegrid.getForProjection(epsg4326);
var tileUrlFunction = ol.TileUrlFunction.createFromParamsFunction(
'http://wms?foo=bar', ol.source.wms.getUrl);
'http://wms', {'foo': 'bar'}, ol.source.wms.getUrl);
var tileCoord = new ol.TileCoord(1, 0, 0);
var tileUrl = tileUrlFunction.call(that, tileCoord, tileGrid, epsg4326);
var expected = 'http://wms?foo=bar&SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
var tileUrl = tileUrlFunction(tileCoord, tileGrid, epsg4326);
var expected = 'http://wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=' +
'GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&' +
'STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';
'foo=bar&STYLES=&CRS=EPSG%3A4326&BBOX=-90%2C-180%2C90%2C0';
expect(tileUrl).to.eql(expected);
});
});
@@ -38,4 +37,3 @@ goog.require('ol.TileCoord');
goog.require('ol.TileUrlFunction');
goog.require('ol.projection');
goog.require('ol.source.wms');
goog.require('ol.tilegrid');

View File

@@ -660,5 +660,4 @@ goog.require('ol.Extent');
goog.require('ol.Size');
goog.require('ol.TileCoord');
goog.require('ol.projection');
goog.require('ol.tilegrid');
goog.require('ol.tilegrid.TileGrid');

View File

@@ -81,14 +81,14 @@ describe('ol.TileUrlFunction', function() {
describe('createFromParamsFunction', function() {
var paramsFunction = function(url, params) { return arguments; };
var projection = ol.projection.get('EPSG:3857');
var params = {foo: 'bar'};
var tileUrlFunction = ol.TileUrlFunction.createFromParamsFunction(
'url', paramsFunction);
'url', params, paramsFunction);
it('calls the passed function with the correct arguments', function() {
var that = {params: {foo: 'bar'}};
var args = tileUrlFunction.call(that, new ol.TileCoord(0, 0, 0),
var args = tileUrlFunction(new ol.TileCoord(0, 0, 0),
ol.tilegrid.getForProjection(projection), projection);
expect(args[0]).to.eql('url');
expect(args[1]).to.be(that.params);
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[4]).to.eql(projection);
@@ -101,4 +101,3 @@ goog.require('ol.Size');
goog.require('ol.TileCoord');
goog.require('ol.TileUrlFunction');
goog.require('ol.projection');
goog.require('ol.tilegrid');