瀏覽代碼

feat: Add link to georeport

jmacura 5 年之前
父節點
當前提交
9a76b29449
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/app.component.ts

+ 8 - 0
src/app.component.ts

@@ -72,6 +72,7 @@ const nuts2style = new Style({
 
 // TODO: 'method' must be obtained from AdjusterService
 const method = 'haclustwd2';
+const serviceUrl = 'https://jmacura.ml/ws/georeport/';
 const nuts3style = function (feature) {
   if (isNaN(feature.get(method))) {
     return [
@@ -120,6 +121,13 @@ nuts3Layer.set('popUp', {
     {attribute: 'CNTR_CODE', label: 'Country'},
     {attribute: 'NUTS_NAME', label: 'Name'},
     {attribute: method, label: 'Cluster ID'},
+    {
+      attribute: 'NUTS_ID',
+      label: 'Detailed report',
+      displayFunction: (x) => {
+        return `<a href="${serviceUrl}${x}" target="_blank">in a new page</a>.`;
+      },
+    },
   ],
 });