I am working on a WMS-based OpenLayers project, which is pulling in data from the BGS WMS Servers. We're pulling the 1:50k bedrock layer from this WMS:
https://map.bgs.ac.uk/arcgis/services/BGS_Detailed_Geology/MapServer/WMSServer?
In OpenLayers 3 I am trying to query the WMS and display the attributes in an iFrame beneath the OpenLayers map. Using the following code, I am able to get the full metadata to display beneath the map.
map.on('singleclick', function(evt) {
document.getElementById('info').innerHTML = '';
var viewResolution = /** @type {number} */ (view.getResolution());
var url = wmsSource.getGetFeatureInfoUrl(
evt.coordinate, viewResolution, 'EPSG:3857',
{'INFO_FORMAT': 'text/html'});
if (url) {
document.getElementById('info').innerHTML =
'<iframe seamless src="' + url + '"></iframe>';
}
});
The thing is, this pulls in ALL of the metadata and I would like to restrict it to just one or two fields, such as LEX, LEX_RCS_D or MAX_TIME_D (see field names here)
I'm not a user of JavaScript, so I'm having difficulties modifying the code.
After some research online, I came across the propertyName parameter, which I've tried implementing, although I'm not even sure this is what I'm looking for.
{'INFO_FORMAT': 'text/html'}, {propertyName: 'LEX'}
Given the way the BGS WMS is configured, is it even possible to limit the attributes which are pulled out on the GetFeatureInfo request?