ソースを参照

🔥 remove now useless nuts.ts file

jmacura 3 年 前
コミット
b212b2474c
4 ファイル変更13 行追加31 行削除
  1. 10 4
      src/app.config.ts
  2. 3 2
      src/app.service.ts
  3. 0 0
      src/data/NUTS_RG_20M_2016_3857_LEVL_2.geojson
  4. 0 25
      src/nuts.ts

+ 10 - 4
src/app.config.ts

@@ -1,12 +1,11 @@
 import {Fill, Stroke, Style} from 'ol/style';
+import {GeoJSON, TopoJSON} from 'ol/format';
 import {OSM, Vector as VectorSource} from 'ol/source';
 import {Tile, Vector as VectorLayer} from 'ol/layer';
-import {TopoJSON} from 'ol/format';
 import {View} from 'ol';
 
 import env from './env.config.json';
 import i18n from './translations.json';
-import {nuts} from './nuts';
 
 function getHostname() {
   const url = window.location.href;
@@ -78,14 +77,21 @@ export const nuts2Layer = new VectorLayer({
     editable: false,
     queryable: false,
   },
-  source: nuts.nuts2Source,
+  source: new VectorSource({
+    //features: new GeoJSON().readFeatures(nuts2),
+    format: new GeoJSON(),
+    // eslint-disable-next-line @typescript-eslint/no-var-requires
+    url: require('./data/NUTS_RG_20M_2016_3857_LEVL_2.geojson').default,
+    overlaps: false,
+  }),
   visible: false,
   style: nuts2style,
 });
 
 export const nuts3IndexSource = new VectorSource({
   //features: new GeoJSON().readFeatures(nuts3),
-  format: new TopoJSON(),
+  format: new TopoJSON({dataProjection: 'EPSG:3857'}),
+  // eslint-disable-next-line @typescript-eslint/no-var-requires
   url: require('./data/NUTS_RG_20M_2016_3857_LEVL_3.topojson').default,
   overlaps: false,
 });

+ 3 - 2
src/app.service.ts

@@ -25,7 +25,6 @@ import {AdjusterLegendService} from './adjuster/adjuster-legend.service';
 import {AdjusterService} from './adjuster/adjuster.service';
 import {AdjusterSimplePanelComponent} from './adjuster/adjuster-simple-panel/adjuster-simple-panel.component';
 import {AppConfig, nuts2Layer, nuts3IndexLayer} from './app.config';
-import {nuts} from './nuts';
 
 @Injectable({providedIn: 'root'})
 export class AppService {
@@ -46,6 +45,7 @@ export class AppService {
     },
     source: new VectorSource({
       format: new GeoJSON(),
+      // eslint-disable-next-line @typescript-eslint/no-var-requires
       url: require('./data/pilot_regions.geojson').default,
     }),
     visible: true,
@@ -112,7 +112,7 @@ export class AppService {
       map.on('click', this.debugMe);
     });*/
     /*this.adjusterEventService.methodChanged.subscribe((method) => {
-      //TODO: prettify this
+      //TODO prettify this
       this.nuts3ClustersLayer.set(
         'title',
         `NUTS3 regions: ${method.replaceAll(/\((.+?)\)/g, '')} Clusters`
@@ -155,6 +155,7 @@ export class AppService {
         source: new VectorSource({
           //features: new GeoJSON().readFeatures(nuts3).map((f) => f.clone()),
           format: new TopoJSON({dataProjection: 'EPSG:3857'}),
+          // eslint-disable-next-line @typescript-eslint/no-var-requires
           url: require('./data/NUTS_RG_20M_2016_3857_LEVL_3.topojson').default,
           overlaps: false,
         }),

+ 0 - 0
src/data/NUTS_RG_20M_2016_3857_LEVL_2.json → src/data/NUTS_RG_20M_2016_3857_LEVL_2.geojson


+ 0 - 25
src/nuts.ts

@@ -1,25 +0,0 @@
-import nuts2 from './data/NUTS_RG_20M_2016_3857_LEVL_2.json';
-//import nuts3 from './data/NUTS_RG_20M_2016_3857_LEVL_3.json';
-import {GeoJSON} from 'ol/format';
-import {Vector as VectorSource} from 'ol/source';
-
-export const nuts = {
-  nuts2Source: new VectorSource({
-    features: new GeoJSON().readFeatures(nuts2),
-    overlaps: false,
-  }),
-
-  /*nuts3IndexSource: new VectorSource({
-    //features: new GeoJSON().readFeatures(nuts3),
-    format: new GeoJSON(),
-    url: require('./data/NUTS_RG_20M_2016_3857_LEVL_3.geojson').default,
-    overlaps: false,
-  }),*/
-
-  /*nuts3ClustersSource: new VectorSource({
-    features: new GeoJSON().readFeatures(nuts3).map((f) => f.clone()),
-    //format: new GeoJSON(),
-    //url: require('./data/NUTS_RG_20M_2016_3857_LEVL_3.geojson').default,
-    overlaps: false,
-  }),*/
-};