diff --git a/src/main/java/org/auscope/portal/server/config/LayerFactory.java b/src/main/java/org/auscope/portal/server/config/LayerFactory.java index 44d253881..6dfc2901a 100644 --- a/src/main/java/org/auscope/portal/server/config/LayerFactory.java +++ b/src/main/java/org/auscope/portal/server/config/LayerFactory.java @@ -187,9 +187,9 @@ public IRISSelector knownTypeIRISSelector(String networkCode, String serviceEndP * The service endpoint that the instance of the selector is concerned with. * @throws MalformedURLException */ - public VMFSelector knownTypeVMFSelector(String layerName, String serviceEndPoint, JSONArray polygonGeoJson) { + public VMFSelector knownTypeVMFSelector(String layerName, String serviceEndPoint, JSONArray polygonGeoJson, String apikey, String maps) { try { - return new VMFSelector(layerName, serviceEndPoint, polygonGeoJson); + return new VMFSelector(layerName, serviceEndPoint, polygonGeoJson, apikey, maps); } catch (MalformedURLException e) { log.error("Malformed URL for VMF service point: " + serviceEndPoint); } @@ -435,10 +435,12 @@ else if (cswKey.startsWith("serviceNames")) { case "vmf": { String layerName = null; String serviceEndPoint = null; + String apikey = null; + String maps = null; JSONArray polygonGeoJson = new JSONArray(); Map x = (Map) v1; - String[] attr = new String[2]; + String[] attr = new String[4]; x.forEach((sk1, sv1) -> { if (sk1.startsWith("selector")) { attr[1] = (String) sv1; @@ -446,6 +448,12 @@ else if (cswKey.startsWith("serviceNames")) { if (sk1.startsWith("endPoint")) { attr[0] = (String) sv1; } + if (sk1.startsWith("apikey")) { + attr[2] = (String) sv1; + } + if (sk1.startsWith("maps")) { + attr[3] = (String) sv1; + } if (sk1.startsWith("polygon_geojson")) { Double[] lon = new Double[1]; @@ -469,11 +477,15 @@ else if (cswKey.startsWith("serviceNames")) { }); layerName = attr[1]; serviceEndPoint = attr[0]; + apikey = attr[2]; + maps = attr[3]; layer.setEndPoint(serviceEndPoint); layer.setPolygon(polygonGeoJson); + layer.setApikey(apikey); + layer.setMaps(maps); - layer.setKnownLayerSelector(knownTypeVMFSelector(layerName,serviceEndPoint,polygonGeoJson)); + layer.setKnownLayerSelector(knownTypeVMFSelector(layerName,serviceEndPoint,polygonGeoJson,apikey,maps)); break; } case "kml": { diff --git a/src/main/resources/layers.yaml b/src/main/resources/layers.yaml index e38172021..898c52526 100644 --- a/src/main/resources/layers.yaml +++ b/src/main/resources/layers.yaml @@ -2206,8 +2206,10 @@ order: "ind01" vmf: selector: "Indigenous Map" - endPoint: "https://native-land.ca/wp-json/nativeland/v1/api/index.php" - polygon_geojson: [[111.64,-17.61],[132.45,-8.23],[146.26,-10.53],[159.37,-24.57],[147.95,-45.25],[110.29,-34.29]] + endPoint: "https://native-land.ca/api/index.php" + polygon_geojson: [[146.26, -10.53], [132.45, -8.23], [111.64, -17.61], [110.29, -34.29], [147.95, -45.25], [159.37, -24.57], [146.26, -10.53]] + apikey: "_7AyXpOSiefzoaCbUaPOM" + maps: "territories" "regolith-depth-layer": name: "Soil and Landscape Grid National Soil Attribute Maps - Depth of Regolith"