-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetFeatureInfo format list in GetCapabilities not respected #9007
Comments
The PR #9054 has already improved the get feature info formats parsing from a WMS capabilities but there are still some missing parts to complete this issue:
Proposal
The problems mentioned in this comment #9007 (comment) should be investigated in different issues |
Thank you @allyoucanmap for the above. I've checked it and discussed briefly with @offtherailz. @offtherailz will review today more in details. |
The ideas are fine for me. Everything looks good. here my comments and suggestions: Point 1:
Point 2:
|
I agree.
I agree with that, but I would maintain the current UI. Therefore this means to perform a getcapa when clicking in the Identify tab of layer settings |
Development tasks summaryPoint 1Improvement on the catalog advanced settings needs following changes:
<FormGroup style={advancedRasterSettingsStyles}>
<Col xs={6}>
<ControlLabel><Message msgId="catalog.infoFormat.label" /></ControlLabel>
</Col >
<Col xs={6} style={{marginBottom: '5px', display: 'flex', alignItems: 'center' }}>
<div style={{ flex: 1 }}>
<Select
isLoading={props.formatsLoading}
onOpen={() => onFormatOptionsFetch(service.url)}
value={service && service.infoFormat}
clearable
options={props.formatsLoading ? [] : infoFormatOptions.map((format) => ({ value: format, label: format }))}
onChange={event => onChangeServiceProperty("infoFormat", event && event.value)} />
</div>
<Button
disabled={props.formatsLoading}
tooltipId="catalog.format.refresh"
className="square-button-md no-border"
onClick={() => onFormatOptionsFetch(service.url, true)}
key="format-refresh">
<Glyphicon glyph="refresh" />
</Button>
</Col >
</FormGroup>
infoFormatOptions={infoFormatOptions}
const {
format: defaultFormat,
infoFormat,
localizedLayerStyles,
allowUnsecureLayers,
autoSetVisibilityLimits,
layerOptions
} = service || {};
const featureInfo = infoFormat && INFO_FORMATS_BY_MIME_TYPE[infoFormat]
? { format: INFO_FORMATS_BY_MIME_TYPE[infoFormat] }
: null;
return {
// ...,
...(featureInfo && { featureInfo }),
// ...
} If we have the select we don't need "magic" computation to detect the default feature info format and it will reduce the complexity Point 2Improvement of the FeatureInfo component to requests info formats if they are missing in the layer (element) configuration as soon as the component mount in the panel. This will need a loading phase. Sample of code (to be verify in development): state = {
loading: false
}
componentDidMount() {
if (!this.props.element.infoFormats || this.props.element.infoFormats?.length === 0) {
this.setState({ loading: true });
getSupportedFormat(this.props.element.url, true)
.then(({ infoFormats }) => {
this.props.onChange("infoFormats", infoFormats);
this.setState({ loading: false });
})
.catch(() => {
this.setState({ loading: false });
});
}
} open question raised during the discussion with @landryb : Could we also save the |
I wouldn't like to complicate things right now by introducing changes that need to be better discussed. I'm open to change the current behavior by saving in the map state both infoFormats and imageFormats but as part of a separated issue and for now maintain the current policy: a request to load the infoFormats when opening the Identify tab. For the rest, all is ok for me. Thank you so much. |
…ns-it#9007) fetches capabilities upon open
otherwise everything blows because infoFormatOptions isn't known ?
…ions-it#9007) convert the infoFormat in the featureInfo layer property by using the INFO_FORMATS_BY_MIME_TYPE utils.
hi @allyoucanmap , i've resumed work on this (cf https://github.com/landryb/MapStore2/commits/wip/9007), but i'm puzzled by this bit. Shouldn't that rather be a new property in the return value of MapStore2/web/client/api/catalog/WMS.js Line 90 in d0b2ab9
return .. but rather an assignation like featureInfo: featureInfo ? that's what i did in 54d3c48
will do more tests, but with that i can select a default infoformat for a service, and layers added from that service use it upon gfi requests. If i go look at the layer properties, in the feature info tab, the default infoformat for the service is correctly highlighted. |
… & IGN french services (#9134) * make sure styles queryparam is defined for GFI requests improves interoperability with mapserver 8, without a style params, GFI requests fail with: "msWMSLoadGetMapParams(): WMS server error. Missing required parameter STYLES. Note to service administrators: defining the "wms_allow_getmap_without_styles" "true" MAP.WEB.METADATA item will disable this check (backward compatibility with behaviour of MapServer < 8.0)" * send the format queryparam in GFI requests too some WMS servers (like IGN national services in france) complain about a missing FORMAT param even if it's not made mandatory nor specified in the spec.
* when displaying layer properties, get supported infoFormats if not already known * display a spinner if we're loading/parsing supported infoFormats * add a new infoFormat selector in advanced raster settings (#9007) fetches capabilities upon open * define an empty infoFormatOptions (#9007) otherwise everything blows because infoFormatOptions isn't known ? * pass infoFormatOptions down to AdvancedSettings in CatalogServiceEditor (#9007) * initialize layer featureInfo from service infoFormat if set (#9007) convert the infoFormat in the featureInfo layer property by using the INFO_FORMATS_BY_MIME_TYPE utils. * add missing semicolon to please eslint * add missing imports to please eslint * add new test for infoFormat onChangeServiceProperty * fix other tests after infoFormat addition * improve onChangeServiceProperty layerOption tileSize test by testing the actual value * fix FeatureInfo-test by making sure url is defined in componentDidMount * default INFO_FORMATS_BY_MIME_TYPE[application/json] to PROPERTIES this way PROPERTIES is highlighted in the featureinfo tab of layer properties if 'application/json' was selected as the default infoFormat for the source catalog entry. * apply some inline style to the Loader displayed while populating featureinfo tab
Description
Same issue as #301 for GetFeatureInfo, whatever the formats proposed by the server mapstore assumes
text/html
andapplication/json
are available.by default mapserver has:
sure, i can add formats to that list by properly configuring mapserver, but only the formats supported by the server should be listed in the featureinfo layer dialog. Sure, its probably the default that's supported by geoserver, but still some interoperability tests would be nice.
What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information
Coming from georchestra/mapstore2-georchestra#302
The text was updated successfully, but these errors were encountered: