Skip to content

Issue #2285 Allow customization of GetFeatureInfo visualization per l…#2286

Merged
offtherailz merged 2 commits intogeosolutions-it:masterfrom
mricca:mapstore2_featureInfo_propTab
Oct 17, 2017
Merged

Issue #2285 Allow customization of GetFeatureInfo visualization per l…#2286
offtherailz merged 2 commits intogeosolutions-it:masterfrom
mricca:mapstore2_featureInfo_propTab

Conversation

@mricca
Copy link
Copy Markdown
Contributor

@mricca mricca commented Oct 13, 2017

…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:

...
        "featureInfo": {
        	"format": "JSON"
        }
...

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • [x ] Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

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)

  • Yes
  • [x ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@ghost ghost assigned mricca Oct 13, 2017
@ghost ghost added the pending review label Oct 13, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.007%) to 80.261% when pulling 0109a66 on mricca:mapstore2_featureInfo_propTab into 2698577 on geosolutions-it:master.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const MapInfoUtils = require('../MapInfoUtils'); in utils/mapinfo/wms.js returns an empty object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if (MapInfoUtils.services[layer.type]) {
        let infoFormat = MapInfoUtils.getDefaultInfoFormatValueFromLayer(layer, props);
        return MapInfoUtils.services[layer.type].buildRequest(layer, props, infoFormat);
    }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

getDefaultInfoFormatValueFromLayer(layer, props) {
if (layer.featureInfo
&& layer.featureInfo.format
&& this.getAvailableInfoFormat()[layer.featureInfo.format]) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use this in a static context. Use MapInfoUtils.

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.005%) to 80.264% when pulling 3852352 on mricca:mapstore2_featureInfo_propTab into 2698577 on geosolutions-it:master.

@offtherailz offtherailz merged commit 68966bf into geosolutions-it:master Oct 17, 2017
@ghost ghost removed the pending review label Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow customization of GetFeatureInfo visualization per layer

4 participants