Bladeren bron

🚧 post-upgrade fixes

+ move to TopoJSON
jmacura 3 jaren geleden
bovenliggende
commit
928cc31611

+ 1 - 0
.gitignore

@@ -34,4 +34,5 @@ pidfile
 src/Attractivity.json
 src/Attractivity.csv
 /.vs
+.angular
 env.config.json

+ 2 - 3
angular.json

@@ -7,7 +7,7 @@
       "projectType": "application",
       "schematics": {
         "@schematics/angular:component": {
-          "style": "sass"
+          "style": "scss"
         }
       },
       "root": "",
@@ -36,8 +36,7 @@
             ],
             "preserveSymlinks": true,
             "styles": [
-              "./node_modules/hslayers-ng/css/hslayers-ng.css",
-              "./src/custom.scss"
+              "./node_modules/hslayers-ng/css/hslayers-ng.css"
             ],
             "scripts": [],
             "vendorChunk": true,

+ 1 - 1
src/adjuster/dataset-list/dataset-list.component.html

@@ -20,7 +20,7 @@
       (click)="descriptionVisible = !descriptionVisible"></span-->
     <!--label class="ps-2 cursor-pointer text-secondary"
       (click)="descriptionVisible = !descriptionVisible">{{dataset.name}}</label-->
-      <label><a class="text-info non-underlined-link" (click)="showMetadataWindow(dataset)">{{getLabelInCurrentLang(dataset.labels)}}</a></label>
+      <label><!-- FIXME: a class="text-info non-underlined-link" (click)="showMetadataWindow(dataset)"-->{{getLabelInCurrentLang(dataset.labels)}}<!--/a--></label>
     <!--div class="p-2 mb-2 text-info" [hidden]="!descriptionVisible">
       {{dataset.desc}}
     </div-->

+ 11 - 12
src/adjuster/metadata-dialog/metadata-dialog.component.ts

@@ -4,11 +4,19 @@ import {HsDialogComponent, HsDialogContainerService} from 'hslayers-ng';
 
 import {MetadataDialogService} from './metadata-dialog.service';
 
+export type DatasetDescriptor = {
+  title: string;
+  coverage?: string;
+  link?: string;
+  lod?: string;
+  source?: string;
+  update?: string;
+};
+
 @Component({
   selector: 'pra-metadata-dialog',
-  templateUrl: './metadata-dialog.component.html' 
+  templateUrl: './metadata-dialog.component.html',
 })
-
 export class MetadataDialogComponent implements HsDialogComponent, OnInit {
   viewRef: ViewRef;
   data: DatasetDescriptor;
@@ -16,7 +24,7 @@ export class MetadataDialogComponent implements HsDialogComponent, OnInit {
   constructor(
     public hsDialogContainerService: HsDialogContainerService,
     public metadataDialogService: MetadataDialogService
-    ) {}
+  ) {}
 
   ngOnInit() {
     this.data = this.metadataDialogService.loadDatasetMetadata(this.data.title);
@@ -26,12 +34,3 @@ export class MetadataDialogComponent implements HsDialogComponent, OnInit {
     this.hsDialogContainerService.destroy(this);
   }
 }
-
-export type DatasetDescriptor = {
-  title: string;
-  coverage?: string;
-  link?: string;
-  lod?: string;
-  source?: string;
-  update?: string;
-};

+ 14 - 3
src/app.config.ts

@@ -75,6 +75,7 @@ export const nuts2Layer = new VectorLayer({
   properties: {
     title: 'NUTS2 regions',
     editor: {editable: false},
+    editable: false,
     queryable: false,
   },
   source: nuts.nuts2Source,
@@ -95,12 +96,21 @@ export const nuts3IndexLayer = new VectorLayer({
     editor: {editable: false},
     autoLegend: false,
     //queryable: false,
+    popUp: {
+      attributes: [
+        {
+          attribute: 'aggregate',
+          label: 'aggregated',
+          //displayFunction: decimal2prettyPerc,
+        },
+      ],
+    },
   },
   source: nuts3IndexSource,
   visible: true,
   style: indexStyle,
 });
-nuts3IndexLayer.set('popUp', {
+/*nuts3IndexLayer.set('popUp', {
   attributes: [
     {
       attribute: 'aggregate',
@@ -108,7 +118,7 @@ nuts3IndexLayer.set('popUp', {
       displayFunction: decimal2prettyPerc,
     },
   ],
-});
+});*/
 
 export const AppConfig = {
   assetsPath: 'assets/hslayers-ng',
@@ -164,7 +174,7 @@ export const AppConfig = {
   panelsEnabled: {
     composition_browser: false,
     feature_crossfilter: false,
-    //info: false,
+    info: false,
     saveMap: false,
     sensors: false,
     tracking: false,
@@ -174,6 +184,7 @@ export const AppConfig = {
     feature_table: false,
     draw: false,
   },
+  reverseLayerList: true,
   status_manager_url: '/statusmanager/',
   sidebarPosition: 'right',
   sizeMode: 'fullscreen',

+ 4 - 13
src/app.service.ts

@@ -3,7 +3,7 @@ import {Injectable} from '@angular/core';
 
 import {Feature} from 'ol';
 import {Fill, Stroke, Style} from 'ol/style';
-import {GeoJSON} from 'ol/format';
+import {GeoJSON, TopoJSON} from 'ol/format';
 import {Geometry} from 'ol/geom';
 import {Vector as VectorLayer} from 'ol/layer';
 import {Vector as VectorSource} from 'ol/source';
@@ -94,16 +94,6 @@ export class AppService {
     /*this.hsEventBus.olMapLoads.subscribe((map) => {
       map.on('click', this.debugMe);
     });*/
-    this.adjusterEventService.loaded.subscribe(({success}) => {
-      if (success) {
-        this.adjusterLegendService.refreshColorPalette(
-          this.adjusterService.numberOfClusters
-        );
-        /*this.colorPalette = this.generateRandomColorPalette(
-          adjusterService.clusters.length
-        );*/
-      }
-    });
     /*this.adjusterEventService.methodChanged.subscribe((method) => {
       //TODO: prettify this
       this.nuts3ClustersLayer.set(
@@ -129,6 +119,7 @@ export class AppService {
       method.layer = new VectorLayer({
         properties: {
           editor: {editable: false},
+          editable: false,
           //queryable: false,
           autoLegend: false,
           title: `NUTS3 regions: ${method.name.replace(
@@ -146,8 +137,8 @@ export class AppService {
         },
         source: 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,
+          format: new TopoJSON({dataProjection: 'EPSG:3857'}),
+          url: require('./data/NUTS_RG_20M_2016_3857_LEVL_3.topojson').default,
           overlaps: false,
         }),
         visible: true,

File diff suppressed because it is too large
+ 0 - 0
src/data/NUTS_RG_20M_2016_3857_LEVL_3.topojson


+ 1 - 0
tsconfig.json

@@ -11,6 +11,7 @@
     "experimentalDecorators": true,
     "importHelpers": true,
     "lib": ["es2018", "dom"],
+    "moduleResolution": "node",
     "resolveJsonModule": true,
     "sourceMap": true,
     "skipLibCheck": true,

Some files were not shown because too many files changed in this diff