ソースを参照

✨ add country overlays

jmacura 4 年 前
コミット
c43881d2cd

+ 0 - 1
src/adjuster/adjuster.service.ts

@@ -161,7 +161,6 @@ export class AdjusterService {
       })
       })
       .toPromise()
       .toPromise()
       .then((attractivenessData: any[]) => {
       .then((attractivenessData: any[]) => {
-        console.log("attractivenessData", attractivenessData)
         /* Spread the 'aggregate' value between 0 and 1 */
         /* Spread the 'aggregate' value between 0 and 1 */
         const min = attractivenessData.reduce((a, b) =>
         const min = attractivenessData.reduce((a, b) =>
           a.aggregate < b.aggregate ? a : b
           a.aggregate < b.aggregate ? a : b

+ 17 - 2
src/app.config.ts

@@ -143,14 +143,14 @@ const countryStyle = new Style({
   }),
   }),
 });
 });
 
 
-export const countryLayer = new VectorLayer({
+export const ugandaLayer = new VectorLayer({
   properties: {
   properties: {
     editor: {editable: false},
     editor: {editable: false},
     title: 'Uganda',
     title: 'Uganda',
   },
   },
   source: new VectorSource({
   source: new VectorSource({
     format: new TopoJSON({dataProjection: 'EPSG:4326'}),
     format: new TopoJSON({dataProjection: 'EPSG:4326'}),
-    url: require('./data/uganda_districts_2020_10p_4326.topojson').default,
+    url: require('./data/uganda_50p.topojson').default,
     attributions: ['HDX, Uganda Bureau of Statistics with support from WHO'],
     attributions: ['HDX, Uganda Bureau of Statistics with support from WHO'],
     overlaps: false,
     overlaps: false,
   }),
   }),
@@ -158,6 +158,21 @@ export const countryLayer = new VectorLayer({
   style: countryStyle,
   style: countryStyle,
 });
 });
 
 
+export const kenyaLayer = new VectorLayer({
+  properties: {
+    editor: {editable: false},
+    title: 'Kenya',
+  },
+  source: new VectorSource({
+    format: new TopoJSON({dataProjection: 'EPSG:4326'}),
+    url: require('./data/kenya_50p.topojson').default,
+    attributions: ['HDX, IEBC'],
+    overlaps: false,
+  }),
+  visible: true,
+  style: countryStyle,
+});
+
 export const AppConfig = {
 export const AppConfig = {
   assetsPath: 'assets/hslayers-ng',
   assetsPath: 'assets/hslayers-ng',
   useProxy: false,
   useProxy: false,

+ 3 - 2
src/app.service.ts

@@ -19,7 +19,7 @@ import {AdjusterComponent} from './adjuster/adjuster.component';
 import {AdjusterEventService} from './adjuster/adjuster-event.service';
 import {AdjusterEventService} from './adjuster/adjuster-event.service';
 import {AdjusterLegendService} from './adjuster/adjuster-legend.service';
 import {AdjusterLegendService} from './adjuster/adjuster-legend.service';
 import {AdjusterService} from './adjuster/adjuster.service';
 import {AdjusterService} from './adjuster/adjuster.service';
-import {AppConfig, countryLayer, districtsIndexLayer} from './app.config';
+import {AppConfig, ugandaLayer, kenyaLayer, districtsIndexLayer} from './app.config';
 
 
 @Injectable({providedIn: 'root'})
 @Injectable({providedIn: 'root'})
 export class AppService {
 export class AppService {
@@ -113,7 +113,8 @@ export class AppService {
         this.adjusterEventService.layerReady.next({name: 'index'})
         this.adjusterEventService.layerReady.next({name: 'index'})
       );
       );
     (districtsIndexLayer.getSource() as any).legend_categories = this.adjusterLegendService.createIndexLegend();
     (districtsIndexLayer.getSource() as any).legend_categories = this.adjusterLegendService.createIndexLegend();
-    AppConfig.default_layers.push(countryLayer as any);
+    AppConfig.default_layers.push(ugandaLayer as any);
+    AppConfig.default_layers.push(kenyaLayer as any);
     this.hsConfig.update(AppConfig);
     this.hsConfig.update(AppConfig);
   }
   }
 
 

ファイルの差分が大きいため隠しています
+ 0 - 0
src/data/kenya_50p.topojson


ファイルの差分が大きいため隠しています
+ 0 - 0
src/data/kenya_districts_2017_10p_4326.topojson


ファイルの差分が大きいため隠しています
+ 0 - 0
src/data/uganda_50p.topojson


ファイルの差分が大きいため隠しています
+ 0 - 0
src/data/uganda_districts_2020_10p_4326.topojson


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません