Skip to content

Commit

Permalink
initialize layer featureInfo from service infoFormat if set (#9007)
Browse files Browse the repository at this point in the history
convert the infoFormat in the featureInfo layer property by using the
INFO_FORMATS_BY_MIME_TYPE utils.
  • Loading branch information
landryb committed Apr 24, 2023
1 parent 0f2d902 commit 54d3c48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/client/api/catalog/WMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Observable } from 'rxjs';
import { getConfigProp, cleanDuplicatedQuestionMarks } from '../../utils/ConfigUtils';
import { getLayerTitleTranslations } from '../../utils/LayersUtils';
import { isValidGetFeatureInfoFormat, isValidGetMapFormat } from '../../utils/WMSUtils';
import { INFO_FORMATS_BY_MIME_TYPE } from '../../utils/FeatureInfoUtils';
import {
extractOGCServicesReferences,
toURLArray,
Expand Down Expand Up @@ -75,6 +76,7 @@ const recordToLayer = (record, {

const {
format: defaultFormat,
infoFormat,
localizedLayerStyles,
allowUnsecureLayers,
autoSetVisibilityLimits,
Expand All @@ -86,12 +88,16 @@ const recordToLayer = (record, {
const format = supportedGetMapFormats?.find((value) => value === defaultFormat)
|| supportedGetMapFormats[0]
|| defaultFormat;
const featureInfo = infoFormat && INFO_FORMATS_BY_MIME_TYPE[infoFormat]
? { format: INFO_FORMATS_BY_MIME_TYPE[infoFormat] }
: null;

let layer = {
type: 'wms',
requestEncoding: record.requestEncoding, // WMTS KVP vs REST, KVP by default
style: record.style,
format,
featureInfo: featureInfo,
url: layerURL,
capabilitiesURL: record.capabilitiesURL,
queryable: record.queryable,
Expand Down

0 comments on commit 54d3c48

Please sign in to comment.