ソースを参照

💄 configure pop-ups

jmacura 4 年 前
コミット
6a7da16548
2 ファイル変更29 行追加6 行削除
  1. 21 6
      src/app.config.ts
  2. 8 0
      src/app.service.ts

+ 21 - 6
src/app.config.ts

@@ -102,18 +102,33 @@ obceIndexLayer.set('popUp', {
   attributes: [
     {
       attribute: 'aggregate',
-      label: 'index',
+      label: 'agregovaný index',
       displayFunction: decimal2prettyPerc,
     },
     {
       attribute: 'Konec chudoby',
       displayFunction: decimal2prettyPerc,
     },
-    'Zdraví a kvalitní život',
-    'Kvalitní vzdělání',
-    'Důstojná práce a ekonomický růst',
-    'Udržitelná města a obce',
-    'Ostatní',
+    {
+      attribute: 'Zdraví a kvalitní život',
+      displayFunction: decimal2prettyPerc,
+    },
+    {
+      attribute: 'Kvalitní vzdělání',
+      displayFunction: decimal2prettyPerc,
+    },
+    {
+      attribute: 'Důstojná práce a ekonomický růst',
+      displayFunction: decimal2prettyPerc,
+    },
+    {
+      attribute: 'Udržitelná města a obce',
+      displayFunction: decimal2prettyPerc,
+    },
+    {
+      attribute: 'Ostatní',
+      displayFunction: decimal2prettyPerc,
+    },
   ],
 });
 obceIndexLayer.set('editable', false);

+ 8 - 0
src/app.service.ts

@@ -92,6 +92,14 @@ export class AppService {
         style: this.generateStyle(method.codename),
         title: `Obce ČR: ${method.name.replaceAll(/\((.+?)\)/g, '')} clusters`,
         attributions: ['CC-BY ČÚZK, 2021'],
+        popUp: {
+          attributes: [
+            {
+              attribute: method.codename,
+              label: 'ID shluku',
+            },
+          ],
+        },
       });
       this.hsConfig.default_layers.push(method.layer);
     }