|
@@ -1,8 +1,10 @@
|
|
|
import * as hsv2rgb from 'hsv2rgb';
|
|
import * as hsv2rgb from 'hsv2rgb';
|
|
|
import {Feature} from 'ol';
|
|
import {Feature} from 'ol';
|
|
|
import {Fill, Stroke, Style} from 'ol/style';
|
|
import {Fill, Stroke, Style} from 'ol/style';
|
|
|
|
|
+import {GeoJSON} from 'ol/format';
|
|
|
import {Injectable} from '@angular/core';
|
|
import {Injectable} from '@angular/core';
|
|
|
import {Vector as VectorLayer} from 'ol/layer';
|
|
import {Vector as VectorLayer} from 'ol/layer';
|
|
|
|
|
+import {Vector as VectorSource} from 'ol/source';
|
|
|
|
|
|
|
|
import {HsConfig} from 'hslayers-ng/config.service';
|
|
import {HsConfig} from 'hslayers-ng/config.service';
|
|
|
import {HsLayoutService} from 'hslayers-ng/components/layout/layout.service';
|
|
import {HsLayoutService} from 'hslayers-ng/components/layout/layout.service';
|
|
@@ -79,6 +81,25 @@ export class AppService {
|
|
|
style: this.nuts3style,
|
|
style: this.nuts3style,
|
|
|
title: 'NUTS3 regions',
|
|
title: 'NUTS3 regions',
|
|
|
});
|
|
});
|
|
|
|
|
+ pilotsStyle = new Style({
|
|
|
|
|
+ stroke: new Stroke({
|
|
|
|
|
+ color: '#1d941d',
|
|
|
|
|
+ width: 1.5,
|
|
|
|
|
+ }),
|
|
|
|
|
+ fill: new Fill({
|
|
|
|
|
+ color: 'rgba(29, 148, 29, 0.2)',
|
|
|
|
|
+ }),
|
|
|
|
|
+ });
|
|
|
|
|
+ pilotRegions = new VectorLayer({
|
|
|
|
|
+ source: new VectorSource({
|
|
|
|
|
+ format: new GeoJSON(),
|
|
|
|
|
+ url: require('./data/pilot_regions.geojson').default,
|
|
|
|
|
+ }),
|
|
|
|
|
+ editor: {editable: false},
|
|
|
|
|
+ visible: true,
|
|
|
|
|
+ style: this.pilotsStyle,
|
|
|
|
|
+ title: 'Polirural Pilot Regions',
|
|
|
|
|
+ });
|
|
|
method: string;
|
|
method: string;
|
|
|
serviceUrl: string;
|
|
serviceUrl: string;
|
|
|
constructor(
|
|
constructor(
|
|
@@ -106,6 +127,19 @@ export class AppService {
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
|
|
+ this.pilotRegions.set('popUp', {
|
|
|
|
|
+ attributes: [
|
|
|
|
|
+ {attribute: 'NUTS_NAME', label: 'Region name'},
|
|
|
|
|
+ //TODO: Uncomment when implemented in the rural-attractiveness-service
|
|
|
|
|
+ /*{
|
|
|
|
|
+ attribute: 'NUTS_ID',
|
|
|
|
|
+ label: 'Pilot region details',
|
|
|
|
|
+ displayFunction: (x) => {
|
|
|
|
|
+ return `<a href="${this.serviceUrl}${x}" target="_blank">in a new page</a>.`;
|
|
|
|
|
+ },
|
|
|
|
|
+ },*/
|
|
|
|
|
+ ],
|
|
|
|
|
+ });
|
|
|
this.adjusterEventService.clustersLoaded.subscribe(() => {
|
|
this.adjusterEventService.clustersLoaded.subscribe(() => {
|
|
|
this.colorPalette = this.generateRandomColorPalette(
|
|
this.colorPalette = this.generateRandomColorPalette(
|
|
|
adjusterService.clusters.length
|
|
adjusterService.clusters.length
|
|
@@ -114,6 +148,7 @@ export class AppService {
|
|
|
/* The order of pushes matter! */
|
|
/* The order of pushes matter! */
|
|
|
this.hsConfig.default_layers.push(this.nuts3Layer);
|
|
this.hsConfig.default_layers.push(this.nuts3Layer);
|
|
|
this.hsConfig.default_layers.push(this.nuts2Layer);
|
|
this.hsConfig.default_layers.push(this.nuts2Layer);
|
|
|
|
|
+ this.hsConfig.default_layers.push(this.pilotRegions);
|
|
|
/*this.hsMapService
|
|
/*this.hsMapService
|
|
|
.loaded()
|
|
.loaded()
|
|
|
.then((map) => this.hsMapService.repopulateLayers([]));*/
|
|
.then((map) => this.hsMapService.repopulateLayers([]));*/
|