From 024f91b1dfc5887dc48ed9be84bef32a0749bda6 Mon Sep 17 00:00:00 2001 From: chrisvpeters Date: Thu, 7 Nov 2024 17:20:19 +1100 Subject: [PATCH] AUS-4270 --- .../core/view/ViewKnownLayerFactory.java | 8 ++++ .../core/view/knownlayer/KnownLayer.java | 38 +++++++++++++++++++ .../core/view/knownlayer/VMFSelector.java | 9 ++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/auscope/portal/core/view/ViewKnownLayerFactory.java b/src/main/java/org/auscope/portal/core/view/ViewKnownLayerFactory.java index e21d0069c..69b10f1ab 100644 --- a/src/main/java/org/auscope/portal/core/view/ViewKnownLayerFactory.java +++ b/src/main/java/org/auscope/portal/core/view/ViewKnownLayerFactory.java @@ -128,6 +128,14 @@ public ModelMap toView(KnownLayer k) { obj.put("serverType", k.getServerType()); } + if (k.getApikey() != null) { + obj.put("apikey", k.getApikey()); + } + + if (k.getMaps() != null) { + obj.put("maps", k.getMaps()); + } + return obj; } diff --git a/src/main/java/org/auscope/portal/core/view/knownlayer/KnownLayer.java b/src/main/java/org/auscope/portal/core/view/knownlayer/KnownLayer.java index add5cf70d..3ec46ad93 100644 --- a/src/main/java/org/auscope/portal/core/view/knownlayer/KnownLayer.java +++ b/src/main/java/org/auscope/portal/core/view/knownlayer/KnownLayer.java @@ -115,6 +115,12 @@ public class KnownLayer implements Serializable { /** VMF - geoJson polygon */ private JSONArray polygon; + /** VMF - maps */ + private String maps; + + /** VMF - apikey */ + private String apikey; + /** geoJson bbox */ private JSONArray bbox; @@ -537,6 +543,38 @@ public JSONArray getPolygon() { return polygon; } + /** + * Set the VMF - maps + * + * @param maps + */ + public void setMaps(String maps) { + this.maps = maps; + } + + /** + * @return the VMF - maps + */ + public String getMaps() { + return maps; + } + + /** + * Set the VMF - apikey + * + * @param endPoint + */ + public void setApikey(String apikey) { + this.apikey = apikey; + } + + /** + * @return the VMF - apikey + */ + public String getApikey() { + return apikey; + } + /** * @return the initial - bbox */ diff --git a/src/main/java/org/auscope/portal/core/view/knownlayer/VMFSelector.java b/src/main/java/org/auscope/portal/core/view/knownlayer/VMFSelector.java index e29451c57..050d3c3d6 100644 --- a/src/main/java/org/auscope/portal/core/view/knownlayer/VMFSelector.java +++ b/src/main/java/org/auscope/portal/core/view/knownlayer/VMFSelector.java @@ -19,16 +19,21 @@ public class VMFSelector implements KnownLayerSelector { * GeoJson polygon used to cookie cut area of interest */ private JSONArray polygonGeoJson; - + /** The apikey - https://api-docs.native-land.ca/get-and-use-your-api-key */ + private String apikey; + /** The maps - There are 3 categories available: territories, languages, and treaties. */ + private String maps; /** * @param serviceEndpoint * The serviceEndpoint that identifies which VMF this KnownLayer is identifying */ - public VMFSelector(String layerName, String serviceEndpoint, JSONArray polygonGeoJson) throws MalformedURLException { + public VMFSelector(String layerName, String serviceEndpoint, JSONArray polygonGeoJson, String apikey, String maps) throws MalformedURLException { this.layerName = layerName; this.serviceEndpoint = new URL(serviceEndpoint); this.polygonGeoJson = polygonGeoJson; + this.apikey = apikey; + this.maps = maps; } /**