|
@@ -1,5 +1,6 @@
|
|
|
import {Component} from '@angular/core';
|
|
import {Component} from '@angular/core';
|
|
|
|
|
|
|
|
|
|
+import {Fill, Stroke, Style} from 'ol/style';
|
|
|
import {GeoJSON} from 'ol/format';
|
|
import {GeoJSON} from 'ol/format';
|
|
|
import {OSM, Vector as VectorSource} from 'ol/source';
|
|
import {OSM, Vector as VectorSource} from 'ol/source';
|
|
|
import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
@@ -20,62 +21,6 @@ export class HslayersAppComponent {
|
|
|
private hsEventBusService: HsEventBusService /* private properties are only visible from within this component class */,
|
|
private hsEventBusService: HsEventBusService /* private properties are only visible from within this component class */,
|
|
|
private hsToastService: HsToastService
|
|
private hsToastService: HsToastService
|
|
|
) {
|
|
) {
|
|
|
- /* Define a geometry of one square polygon */
|
|
|
|
|
- const geojsonObject = {
|
|
|
|
|
- 'type': 'FeatureCollection',
|
|
|
|
|
- 'crs': {
|
|
|
|
|
- 'type': 'name',
|
|
|
|
|
- 'properties': {
|
|
|
|
|
- 'name': 'EPSG:3857',
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- 'features': [
|
|
|
|
|
- {
|
|
|
|
|
- 'type': 'Feature',
|
|
|
|
|
- 'geometry': {
|
|
|
|
|
- 'type': 'Polygon',
|
|
|
|
|
- 'coordinates': [
|
|
|
|
|
- [
|
|
|
|
|
- [1e6, 6e6],
|
|
|
|
|
- [1e6, 8e6],
|
|
|
|
|
- [3e6, 8e6],
|
|
|
|
|
- [3e6, 6e6],
|
|
|
|
|
- [1e6, 6e6],
|
|
|
|
|
- ],
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- 'properties': {
|
|
|
|
|
- 'name': 'Poly 1',
|
|
|
|
|
- 'population': Math.floor(Math.random() * 100000),
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- };
|
|
|
|
|
- /* Define the polygon's style using SLD */
|
|
|
|
|
- const polygonSld = `<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
|
- <StyledLayerDescriptor version="1.0.0"
|
|
|
|
|
- xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
|
|
|
|
|
- xmlns="http://www.opengis.net/sld"
|
|
|
|
|
- xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
|
|
- xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
|
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
|
|
- <NamedLayer>
|
|
|
|
|
- <Name>Simple point with stroke</Name>
|
|
|
|
|
- <UserStyle>
|
|
|
|
|
- <Title>Default</Title>
|
|
|
|
|
- <FeatureTypeStyle>
|
|
|
|
|
- <Rule>
|
|
|
|
|
- <PolygonSymbolizer>
|
|
|
|
|
- <Fill>
|
|
|
|
|
- <CssParameter name="fill">#000080</CssParameter>
|
|
|
|
|
- </Fill>
|
|
|
|
|
- </PolygonSymbolizer>
|
|
|
|
|
- </Rule>
|
|
|
|
|
- </FeatureTypeStyle>
|
|
|
|
|
- </UserStyle>
|
|
|
|
|
- </NamedLayer>
|
|
|
|
|
- </StyledLayerDescriptor>
|
|
|
|
|
- `;
|
|
|
|
|
/* Define and update the HsConfig configuration object */
|
|
/* Define and update the HsConfig configuration object */
|
|
|
this.hsConfig.update({
|
|
this.hsConfig.update({
|
|
|
datasources: [
|
|
datasources: [
|
|
@@ -87,12 +32,12 @@ export class HslayersAppComponent {
|
|
|
type: 'layman',
|
|
type: 'layman',
|
|
|
liferayProtocol: 'https',
|
|
liferayProtocol: 'https',
|
|
|
},*/
|
|
},*/
|
|
|
- {
|
|
|
|
|
|
|
+ /*{
|
|
|
title: 'Micka',
|
|
title: 'Micka',
|
|
|
url: 'https://hub.sieusoil.eu/cat/csw',
|
|
url: 'https://hub.sieusoil.eu/cat/csw',
|
|
|
language: 'eng',
|
|
language: 'eng',
|
|
|
type: 'micka',
|
|
type: 'micka',
|
|
|
- },
|
|
|
|
|
|
|
+ },*/
|
|
|
],
|
|
],
|
|
|
/* Use hslayers-server if you need to proxify your requests to other services. See https://www.npmjs.com/package/hslayers-server */
|
|
/* Use hslayers-server if you need to proxify your requests to other services. See https://www.npmjs.com/package/hslayers-server */
|
|
|
/* proxyPrefix: window.location.hostname.includes('localhost')
|
|
/* proxyPrefix: window.location.hostname.includes('localhost')
|
|
@@ -101,10 +46,15 @@ export class HslayersAppComponent {
|
|
|
*/
|
|
*/
|
|
|
useProxy: false,
|
|
useProxy: false,
|
|
|
panelsEnabled: {
|
|
panelsEnabled: {
|
|
|
- tripPlanner: true,
|
|
|
|
|
|
|
+ tripPlanner: false,
|
|
|
|
|
+ datasource_selector: false,
|
|
|
|
|
+ composition_browser: false,
|
|
|
|
|
+ saveMap: false,
|
|
|
|
|
+ draw: false,
|
|
|
|
|
+ permalink: false,
|
|
|
},
|
|
},
|
|
|
componentsEnabled: {
|
|
componentsEnabled: {
|
|
|
- basemapGallery: true,
|
|
|
|
|
|
|
+ basemapGallery: false,
|
|
|
},
|
|
},
|
|
|
assetsPath: 'assets',
|
|
assetsPath: 'assets',
|
|
|
symbolizerIcons: [
|
|
symbolizerIcons: [
|
|
@@ -114,6 +64,7 @@ export class HslayersAppComponent {
|
|
|
{name: 'mountain', url: '/assets/icons/mountain42.svg'},
|
|
{name: 'mountain', url: '/assets/icons/mountain42.svg'},
|
|
|
{name: 'warning', url: '/assets/icons/warning.svg'},
|
|
{name: 'warning', url: '/assets/icons/warning.svg'},
|
|
|
],
|
|
],
|
|
|
|
|
+ sidebarClosed: true,
|
|
|
popUpDisplay: 'hover',
|
|
popUpDisplay: 'hover',
|
|
|
default_layers: [
|
|
default_layers: [
|
|
|
/* One baselayer */
|
|
/* One baselayer */
|
|
@@ -127,42 +78,41 @@ export class HslayersAppComponent {
|
|
|
},
|
|
},
|
|
|
}),
|
|
}),
|
|
|
/* One thematic layer */
|
|
/* One thematic layer */
|
|
|
- new VectorLayer({
|
|
|
|
|
|
|
+ //FIXME: missing loader?
|
|
|
|
|
+ /*new VectorLayer({
|
|
|
properties: {
|
|
properties: {
|
|
|
- title: 'Polygon vector layer',
|
|
|
|
|
- synchronize: false,
|
|
|
|
|
- cluster: false,
|
|
|
|
|
- inlineLegend: true,
|
|
|
|
|
- popUp: {
|
|
|
|
|
- attributes: ['population'],
|
|
|
|
|
- },
|
|
|
|
|
- editor: {
|
|
|
|
|
- editable: true,
|
|
|
|
|
- defaultAttributes: {
|
|
|
|
|
- name: 'New polygon',
|
|
|
|
|
- description: 'none',
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- sld: polygonSld,
|
|
|
|
|
- path: 'User generated',
|
|
|
|
|
|
|
+ title: 'Polirural Pilot Regions',
|
|
|
|
|
+ editor: {editable: false},
|
|
|
},
|
|
},
|
|
|
source: new VectorSource({
|
|
source: new VectorSource({
|
|
|
- features: new GeoJSON().readFeatures(geojsonObject),
|
|
|
|
|
|
|
+ format: new GeoJSON(),
|
|
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
|
+ url: require('../assets/data/pilot_regions.geojson').default,
|
|
|
}),
|
|
}),
|
|
|
- }),
|
|
|
|
|
|
|
+ visible: true,
|
|
|
|
|
+ style: new Style({
|
|
|
|
|
+ stroke: new Stroke({
|
|
|
|
|
+ color: '#1d941d',
|
|
|
|
|
+ width: 1.5,
|
|
|
|
|
+ }),
|
|
|
|
|
+ fill: new Fill({
|
|
|
|
|
+ color: 'rgba(29, 148, 29, 0.2)',
|
|
|
|
|
+ }),
|
|
|
|
|
+ }),
|
|
|
|
|
+ }),*/
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
/* Now wait for the OpenLayers Map object to load */
|
|
/* Now wait for the OpenLayers Map object to load */
|
|
|
this.hsEventBusService.olMapLoads.subscribe(() => {
|
|
this.hsEventBusService.olMapLoads.subscribe(() => {
|
|
|
/* ...and display a simple toast message in the bottom-left corner */
|
|
/* ...and display a simple toast message in the bottom-left corner */
|
|
|
- this.hsToastService.createToastPopupMessage(
|
|
|
|
|
- 'READY!',
|
|
|
|
|
- 'Your map is now ready to use.',
|
|
|
|
|
- {
|
|
|
|
|
- toastStyleClasses:
|
|
|
|
|
- 'bg-success text-white' /* Use any Bootstrap class here, see https://getbootstrap.com/docs/4.0/utilities/colors/ */,
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ // this.hsToastService.createToastPopupMessage(
|
|
|
|
|
+ // 'READY!',
|
|
|
|
|
+ // 'Your map is now ready to use.',
|
|
|
|
|
+ // {
|
|
|
|
|
+ // toastStyleClasses:
|
|
|
|
|
+ // 'bg-success text-white' /* Use any Bootstrap class here, see https://getbootstrap.com/docs/4.0/utilities/colors/ */,
|
|
|
|
|
+ // }
|
|
|
|
|
+ // );
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|