Issue #2285 Allow customization of GetFeatureInfo visualization per l…#2286
Conversation
…alization per layer
web/client/utils/MapInfoUtils.js
Outdated
| buildIdentifyRequest(layer, props) { | ||
| if (MapInfoUtils.services[layer.type]) { | ||
| return MapInfoUtils.services[layer.type].buildRequest(layer, props); | ||
| return MapInfoUtils.services[layer.type].buildRequest(layer, props, MapInfoUtils); |
There was a problem hiding this comment.
const MapInfoUtils = require('../MapInfoUtils'); in utils/mapinfo/wms.js returns an empty object.
There was a problem hiding this comment.
if (MapInfoUtils.services[layer.type]) {
let infoFormat = MapInfoUtils.getDefaultInfoFormatValueFromLayer(layer, props);
return MapInfoUtils.services[layer.type].buildRequest(layer, props, infoFormat);
}
There was a problem hiding this comment.
This is because there is a dependency loop (MapInfoUtils includes services/wms too). This is usually a sign of bad design.
My suggestion is to move getAvailableInfoFormat and other WMS specific functionalities inside wms.js.
| <Tab key={2} eventKey={2} title={<Message msgId="layerProperties.display" />}>{display}</Tab>, | ||
| <Tab key={3} eventKey={3} title={<Message msgId="layerProperties.style" />} disabled={!style} >{style}</Tab>] | ||
| <Tab key={3} eventKey={3} title={<Message msgId="layerProperties.style" />} disabled={!style} >{style}</Tab>, | ||
| <Tab key={4} eventKey={4} title={<Message msgId="layerProperties.featureInfo" />} disabled={false} >{featurePopup}</Tab>] |
There was a problem hiding this comment.
The tab should not be visible (not only disabled) for layers that are not wms or if it is not queriable. Now it is visible and empty
An option to hide this tab also via configuration should be present.
web/client/utils/MapInfoUtils.js
Outdated
| getDefaultInfoFormatValueFromLayer(layer, props) { | ||
| if (layer.featureInfo | ||
| && layer.featureInfo.format | ||
| && this.getAvailableInfoFormat()[layer.featureInfo.format]) { |
There was a problem hiding this comment.
Do not use this in a static context. Use MapInfoUtils.
web/client/utils/MapInfoUtils.js
Outdated
| buildIdentifyRequest(layer, props) { | ||
| if (MapInfoUtils.services[layer.type]) { | ||
| return MapInfoUtils.services[layer.type].buildRequest(layer, props); | ||
| return MapInfoUtils.services[layer.type].buildRequest(layer, props, MapInfoUtils); |
There was a problem hiding this comment.
This is because there is a dependency loop (MapInfoUtils includes services/wms too). This is usually a sign of bad design.
My suggestion is to move getAvailableInfoFormat and other WMS specific functionalities inside wms.js.
…ayer
Description
The users can now customize the getFeatureInfo output format for each layer from the tab "Feature Info" of the Layer Properties panel.
This is the configuration setting, for the moment, to customize the inizial viewer, from the layer config:
Issues
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
What is the current behavior? (You can also link to an open issue here)
Now the feature info visualization can be change only from settings for all layers
What is the new behavior?
Now the feature info visualization can customize for a single layer in layer properties panel
Does this PR introduce a breaking change? (check one with "x", remove the other)
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: