Use X, Y or I, J depending on WMS version

This also adds consistency - Pixel coordinates are now always
rounded to integers.
This commit is contained in:
ahocevar
2013-08-08 14:43:49 +02:00
parent c1746f2549
commit 2f37816608
4 changed files with 41 additions and 42 deletions

View File

@@ -28,22 +28,22 @@ describe('ol.source.wms', function() {
describe('ol.source.wms.getFeatureInfo', function() {
it('calls a callback with a feature info IFRAME as result', function(done) {
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&LAYERS=foo',
{params: {'INFO_FORMAT': 'text/plain'}},
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&VERSION=1.3&LAYERS=foo',
[5, 10], {params: {'INFO_FORMAT': 'text/plain'}},
function(info) {
expect(info).to.eql('<iframe seamless src="' +
'?REQUEST=GetFeatureInfo&LAYERS=foo&QUERY_LAYERS=foo&' +
'INFO_FORMAT=text%2Fplain"></iframe>');
'?REQUEST=GetFeatureInfo&VERSION=1.3&LAYERS=foo&QUERY_LAYERS=' +
'foo&INFO_FORMAT=text%2Fplain&I=5&J=10"></iframe>');
done();
});
});
it('can do xhr to retrieve feature info', function(done) {
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&LAYERS=foo', {
method: ol.source.WMSGetFeatureInfoMethod.XHR_GET
}, function(info) {
expect(info).to.contain('<html>');
done();
});
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&VERSION=1.1.1&LAYERS=foo',
[5, 10], {method: ol.source.WMSGetFeatureInfoMethod.XHR_GET},
function(info) {
expect(info).to.contain('<html>');
done();
});
});
});