From b7d55a975a4136da63aa4bedc6abecd84b908482 Mon Sep 17 00:00:00 2001 From: Pekka Helesuo Date: Thu, 30 Nov 2023 14:42:00 +0200 Subject: [PATCH] add layer's gfitype to response --- .../nls/oskari/map/data/service/GetGeoPointDataService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service-map/src/main/java/fi/nls/oskari/map/data/service/GetGeoPointDataService.java b/service-map/src/main/java/fi/nls/oskari/map/data/service/GetGeoPointDataService.java index 25319fdbea..1e68f20042 100755 --- a/service-map/src/main/java/fi/nls/oskari/map/data/service/GetGeoPointDataService.java +++ b/service-map/src/main/java/fi/nls/oskari/map/data/service/GetGeoPointDataService.java @@ -35,6 +35,7 @@ public class GetGeoPointDataService { public static final String PRESENTATION_TYPE = "presentationType"; public static final String CONTENT = "content"; public static final String PARSED = "parsed"; + public static final String GFI_TYPE = "gfiType"; public static final String GFI_CONTENT = "gfiContent"; public static final String KEY_INFO = "Info"; public static final String MESSAGE_NO_SUPPORT = "Feature data not supported on this layer"; @@ -67,11 +68,15 @@ public JSONObject getWMSFeatureInfo(final GFIRequestParams params) { JSONHelper.putValue(response, CONTENT, respObj); } } + // use text content if respObj isn't present (transformed JSON not created) if(respObj == null) { JSONHelper.putValue(response, PRESENTATION_TYPE, PRESENTATION_TYPE_TEXT); // Note! This might not be html. Might be xml or plain text etc JSONHelper.putValue(response, CONTENT, getSafeHtmlContent(gfiResponse, params.getGFIUrl())); + if (params.getLayer().getGfiType() != null) { + JSONHelper.putValue(response, GFI_TYPE, params.getLayer().getGfiType()); + } } // Add gfi content, it needs to be a separate field so we can mangle it as we like in the frontend final String gfiContent = params.getLayer().getGfiContent();