make sure parameter name lookups are case-insensitive
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
goog.provide('ol.source.WMSGetFeatureInfoMethod');
|
goog.provide('ol.source.WMSGetFeatureInfoMethod');
|
||||||
goog.provide('ol.source.wms');
|
goog.provide('ol.source.wms');
|
||||||
|
|
||||||
|
goog.require('goog.Uri');
|
||||||
goog.require('goog.net.XhrIo');
|
goog.require('goog.net.XhrIo');
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('goog.uri.utils');
|
goog.require('goog.uri.utils');
|
||||||
@@ -95,12 +96,11 @@ ol.source.wms.getFeatureInfo =
|
|||||||
goog.object.extend(params, {'X': x, 'Y': y});
|
goog.object.extend(params, {'X': x, 'Y': y});
|
||||||
}
|
}
|
||||||
goog.object.extend(params, localOptions.params);
|
goog.object.extend(params, localOptions.params);
|
||||||
|
var uri = new goog.Uri(url, true);
|
||||||
for (var key in params) {
|
for (var key in params) {
|
||||||
if (goog.uri.utils.hasParam(url, key)) {
|
uri.setParameterValue(key, params[key]);
|
||||||
url = goog.uri.utils.removeParam(url, key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
url = goog.uri.utils.appendParamsFromMap(url, params);
|
url = uri.toString();
|
||||||
if (localOptions.method == ol.source.WMSGetFeatureInfoMethod.IFRAME) {
|
if (localOptions.method == ol.source.WMSGetFeatureInfoMethod.IFRAME) {
|
||||||
goog.global.setTimeout(function() {
|
goog.global.setTimeout(function() {
|
||||||
success('<iframe seamless src="' + url + '"></iframe>');
|
success('<iframe seamless src="' + url + '"></iframe>');
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ describe('ol.source.wms', function() {
|
|||||||
[5, 10], {params: {'INFO_FORMAT': 'text/plain'}},
|
[5, 10], {params: {'INFO_FORMAT': 'text/plain'}},
|
||||||
function(info) {
|
function(info) {
|
||||||
expect(info).to.eql('<iframe seamless src="' +
|
expect(info).to.eql('<iframe seamless src="' +
|
||||||
'?REQUEST=GetFeatureInfo&VERSION=1.3&LAYERS=foo&QUERY_LAYERS=' +
|
'?request=GetFeatureInfo&version=1.3&layers=foo&query_layers=' +
|
||||||
'foo&INFO_FORMAT=text%2Fplain&I=5&J=10"></iframe>');
|
'foo&info_format=text%2Fplain&i=5&j=10"></iframe>');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -47,12 +47,12 @@ describe('ol.source.wms', function() {
|
|||||||
});
|
});
|
||||||
it('overrides any existing parameters', function(done) {
|
it('overrides any existing parameters', function(done) {
|
||||||
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&VERSION=1.3&LAYERS=' +
|
ol.source.wms.getFeatureInfo('?REQUEST=GetMap&VERSION=1.3&LAYERS=' +
|
||||||
'foo&STYLES=x',
|
'foo&styles=x',
|
||||||
[5, 10], {params: {'INFO_FORMAT': 'text/plain', STYLES: 'y'}},
|
[5, 10], {params: {'INFO_FORMAT': 'text/plain', STYLES: 'y'}},
|
||||||
function(info) {
|
function(info) {
|
||||||
expect(info).to.eql('<iframe seamless src="' +
|
expect(info).to.eql('<iframe seamless src="' +
|
||||||
'?REQUEST=GetFeatureInfo&VERSION=1.3&LAYERS=foo&QUERY_LAYERS=' +
|
'?request=GetFeatureInfo&version=1.3&layers=foo&query_layers=' +
|
||||||
'foo&INFO_FORMAT=text%2Fplain&I=5&J=10&STYLES=y"></iframe>');
|
'foo&styles=y&info_format=text%2Fplain&i=5&j=10"></iframe>');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user