|
|
@@ -1,8 +1,9 @@
|
|
|
import hsv2rgb from 'hsv2rgb';
|
|
|
+import {Injectable} from '@angular/core';
|
|
|
+
|
|
|
import {Feature} from 'ol';
|
|
|
import {Fill, Stroke, Style} from 'ol/style';
|
|
|
import {GeoJSON} from 'ol/format';
|
|
|
-import {Injectable} from '@angular/core';
|
|
|
import {Vector as VectorLayer} from 'ol/layer';
|
|
|
import {Vector as VectorSource} from 'ol/source';
|
|
|
|
|
|
@@ -50,16 +51,14 @@ export class AppService {
|
|
|
title: 'NUTS2 regions',
|
|
|
});
|
|
|
nuts3IndexLayer = new VectorLayer({
|
|
|
- source: nuts.nuts3Source,
|
|
|
+ source: nuts.nuts3IndexSource,
|
|
|
editor: {editable: false},
|
|
|
visible: true,
|
|
|
- style: (f) => {
|
|
|
- return this.indexStyle(f);
|
|
|
- },
|
|
|
+ style: (f) => this.indexStyle(f),
|
|
|
title: 'NUTS3 regions: Rural attractiveness index',
|
|
|
});
|
|
|
nuts3ClustersLayer = new VectorLayer({
|
|
|
- source: nuts.nuts3Source,
|
|
|
+ source: nuts.nuts3ClustersSource,
|
|
|
editor: {editable: false},
|
|
|
visible: true,
|
|
|
style: this.generateStyle(this.adjusterService.method),
|
|
|
@@ -117,6 +116,12 @@ export class AppService {
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
+ // For debugging only
|
|
|
+ /*this.hsEventBus.olMapLoads.subscribe((map) => {
|
|
|
+ map.on('click', this.debugMe);
|
|
|
+ });*/
|
|
|
+ this.nuts3IndexLayer.set('editable', false);
|
|
|
+ this.nuts3IndexLayer.set('queryable', false);
|
|
|
this.nuts3ClustersLayer.set('popUp', {
|
|
|
attributes: [
|
|
|
{attribute: 'CNTR_CODE', label: 'Country'},
|
|
|
@@ -290,4 +295,10 @@ export class AppService {
|
|
|
const h = r * 0x10000 + g * 0x100 + b * 0x1;
|
|
|
return `rgba(${r}, ${g}, ${b}, 0.7)`;
|
|
|
};
|
|
|
+
|
|
|
+ private debugMe(e) {
|
|
|
+ console.log(e);
|
|
|
+ const feats = e.map.getFeaturesAtPixel(e.pixel);
|
|
|
+ console.log(feats);
|
|
|
+ }
|
|
|
}
|