From 817d444ae1aad33b67078f8fa9790239aa41563a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 25 Oct 2023 16:06:25 +0200 Subject: [PATCH] Support application/geo+json --- src/datasource/ExternalDataSourcesManager.js | 5 ++++- src/datasource/OGC.js | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/datasource/ExternalDataSourcesManager.js b/src/datasource/ExternalDataSourcesManager.js index e1a325c11c21..11d3db8d63b8 100644 --- a/src/datasource/ExternalDataSourcesManager.js +++ b/src/datasource/ExternalDataSourcesManager.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2017-2022 Camptocamp SA +// Copyright (c) 2017-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -374,6 +374,9 @@ export class ExternalDatSourcesManager { if (wmsInfoFormat === undefined) { wmsInfoFormat = infoFormats.includes(WMSInfoFormat.GEOJSON) ? WMSInfoFormat.GEOJSON : undefined; } + if (wmsInfoFormat === undefined) { + wmsInfoFormat = infoFormats.includes(WMSInfoFormat.GEO_JSON) ? WMSInfoFormat.GEO_JSON : undefined; + } // queryable const queryable = layer.queryable === true && wmsInfoFormat !== undefined; diff --git a/src/datasource/OGC.js b/src/datasource/OGC.js index c4858beeb2e6..53f20f8ee885 100644 --- a/src/datasource/OGC.js +++ b/src/datasource/OGC.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2017-2022 Camptocamp SA +// Copyright (c) 2017-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -89,6 +89,7 @@ export const WFSOutputFormat = { */ export const WMSInfoFormat = { GEOJSON: 'application/geojson', + GEO_JSON: 'application/geo+json', GML: 'application/vnd.ogc.gml', }; @@ -478,6 +479,7 @@ export class GmfDatasourceOGC extends ngeoDatasourceDataSource { wmsInfoFormat = options.wmsInfoFormat; } else { if (this.ogcServerType_ === ServerType.ARCGIS) { + // TODO wmsInfoFormat = WMSInfoFormat.GEOJSON; } else { wmsInfoFormat = WMSInfoFormat.GML; @@ -587,7 +589,10 @@ export class GmfDatasourceOGC extends ngeoDatasourceDataSource { wmsFormat = new olFormatWMSGetFeatureInfo({ layers: wmsLayerNames, }); - } else if (this.wmsInfoFormat === WMSInfoFormat.GEOJSON) { + } else if ( + this.wmsInfoFormat === WMSInfoFormat.GEOJSON || + this.wmsInfoFormat === WMSInfoFormat.GEO_JSON + ) { wmsFormat = new ngeoFormatArcGISGeoJSON({ layers: wmsLayerNames, });