Skip to content

Commit

Permalink
Support application/geo+json
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 25, 2023
1 parent 7722cfe commit 817d444
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/datasource/ExternalDataSourcesManager.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions src/datasource/OGC.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -89,6 +89,7 @@ export const WFSOutputFormat = {
*/
export const WMSInfoFormat = {
GEOJSON: 'application/geojson',
GEO_JSON: 'application/geo+json',
GML: 'application/vnd.ogc.gml',
};

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit 817d444

Please sign in to comment.