Browse Source

💄 change index layer style a bit

jmacura 4 years ago
parent
commit
11b400250b
1 changed files with 10 additions and 9 deletions
  1. 10 9
      src/app.config.ts

+ 10 - 9
src/app.config.ts

@@ -36,12 +36,7 @@ export const osmLayer = new Tile({
   removable: false,
 });
 
-const stroke = new Stroke({
-  color: '#3399CC',
-  width: 0.25,
-});
-
-function perc2color(perc) {
+export const perc2color = (perc: number): string => {
   perc = perc * 100;
   let r;
   let g;
@@ -56,7 +51,7 @@ function perc2color(perc) {
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
   const h = r * 0x10000 + g * 0x100 + b * 0x1;
   return `rgba(${r}, ${g}, ${b}, 0.7)`;
-}
+};
 
 const decimal2prettyPerc = (x) => {
   return `${(x * 100).toFixed(2)} %`;
@@ -69,7 +64,10 @@ const indexStyle = (feature) => {
         fill: new Fill({
           color: '#FFF',
         }),
-        stroke: stroke,
+        stroke: new Stroke({
+          color: '#3399CC',
+          width: 0.25,
+        }),
       }),
     ];
   } else {
@@ -78,7 +76,10 @@ const indexStyle = (feature) => {
         fill: new Fill({
           color: perc2color(feature.get('aggregate')),
         }),
-        stroke: stroke,
+        stroke: new Stroke({
+          color: '#FFFFFF',
+          width: 0.15,
+        }),
       }),
     ];
   }