Skip to content

Commit

Permalink
Merge pull request #1033 from DenverCoder544/wms_gfitype_json
Browse files Browse the repository at this point in the history
add layer's gfitype to response
  • Loading branch information
ZakarFin authored Nov 30, 2023
2 parents 56f598d + b7d55a9 commit 3bcfbcf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3bcfbcf

Please sign in to comment.