From 623e38b429a3576f214d087876d379688913d126 Mon Sep 17 00:00:00 2001
From: esikkala <esko.ikkala@aalto.fi>
Date: Fri, 26 Mar 2021 16:00:21 +0200
Subject: [PATCH] Add nls-wmts API path

---
 .../components/facet_results/LeafletMap.js    |  4 +--
 src/server/openapi.yaml                       | 31 +++++++++++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/client/components/facet_results/LeafletMap.js b/src/client/components/facet_results/LeafletMap.js
index 9e68721c..251e70c5 100644
--- a/src/client/components/facet_results/LeafletMap.js
+++ b/src/client/components/facet_results/LeafletMap.js
@@ -205,11 +205,11 @@ class LeafletMap extends React.Component {
       Password protected base layers from https://www.maanmittauslaitos.fi/karttakuvapalvelu/tekninen-kuvaus-wmts
       Routed via backend.
     */
-    // const backgroundMapNLS = L.tileLayer(`${apiUrl}/nls-wmts?z={z}&x={x}&y={y}&layerID=taustakartta`, {
+    // const backgroundMapNLS = L.tileLayer(`${process.env.API_URL}/nls-wmts?z={z}&x={x}&y={y}&layerID=taustakartta`, {
     //   attribution: 'National Land Survey of Finland',
     //   maxZoom: 18
     // })
-    // const topographicalMapNLS = L.tileLayer(`${apiUrl}/nls-wmts?z={z}&x={x}&y={y}&layerID=maastokartta`, {
+    // const topographicalMapNLS = L.tileLayer(`${process.env.API_URL}/nls-wmts?z={z}&x={x}&y={y}&layerID=maastokartta`, {
     //   attribution: 'National Land Survey of Finland',
     //   maxZoom: 18
     // })
diff --git a/src/server/openapi.yaml b/src/server/openapi.yaml
index 4afd7624..011316fc 100644
--- a/src/server/openapi.yaml
+++ b/src/server/openapi.yaml
@@ -473,6 +473,37 @@ paths:
               schema:
                 type: string
                 format: binary     
+  /nls-wmts:
+    get:
+      summary: Route for password protected WMTS layers. 
+      parameters:
+        - in: query
+          name: layerID
+          schema: 
+            type: string
+          required: true
+        - in: query
+          name: x
+          schema: 
+            type: string
+          required: true
+        - in: query
+          name: y 
+          schema: 
+            type: string
+          required: true
+        - in: query
+          name: z
+          schema: 
+            type: string
+          required: true  
+      responses:
+        '200':
+          description: An array of GeoJSON layers.
+          content:
+            application/json:
+              schema:
+                type: array     
   /void/{perspectiveID}:
     get:
       summary: Retrieve a VoID description
-- 
GitLab