|
|
@@ -1,22 +1,28 @@
|
|
|
-import {Injectable} from '@angular/core';
|
|
|
+import { Injectable, OnInit } from '@angular/core';
|
|
|
|
|
|
-import {GeoJSON} from 'ol/format';
|
|
|
-import {OSM, Vector as VectorSource} from 'ol/source';
|
|
|
-import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
|
+import { GeoJSON } from 'ol/format';
|
|
|
+import { OSM, Vector as VectorSource } from 'ol/source';
|
|
|
+import { Tile, Vector as VectorLayer } from 'ol/layer';
|
|
|
|
|
|
import {
|
|
|
HsConfig,
|
|
|
HsEventBusService,
|
|
|
- HsToastService
|
|
|
+ HsToastService,
|
|
|
+ HsSidebarService,
|
|
|
+ HsPanelContainerService
|
|
|
} from 'hslayers-ng';
|
|
|
|
|
|
-@Injectable({providedIn: 'root'})
|
|
|
+import { BcInfoComponent } from './bc-info/bc-info.component';
|
|
|
+
|
|
|
+@Injectable({ providedIn: 'root' })
|
|
|
export class AppService {
|
|
|
constructor(
|
|
|
public hsConfig: HsConfig,
|
|
|
private hsEventBusService: HsEventBusService, /* private properties are only visible from within this component class */
|
|
|
- private hsToastService: HsToastService
|
|
|
- ) {
|
|
|
+ private hsToastService: HsToastService,
|
|
|
+ private hsSidebarService: HsSidebarService,
|
|
|
+ private hsPanelContainerService: HsPanelContainerService
|
|
|
+ ) {
|
|
|
/* Define a geometry of one square polygon */
|
|
|
/*const geojsonObject = {
|
|
|
'type': 'FeatureCollection',
|
|
|
@@ -106,11 +112,11 @@ export class AppService {
|
|
|
},
|
|
|
assetsPath: 'assets',
|
|
|
symbolizerIcons: [
|
|
|
- {name: 'beach', url: '/assets/icons/beach17.svg'},
|
|
|
- {name: 'bicycles', url: '/assets/icons/bicycles.svg'},
|
|
|
- {name: 'coffee-shop', url: '/assets/icons/coffee-shop1.svg'},
|
|
|
- {name: 'mountain', url: '/assets/icons/mountain42.svg'},
|
|
|
- {name: 'warning', url: '/assets/icons/warning.svg'},
|
|
|
+ { name: 'beach', url: '/assets/icons/beach17.svg' },
|
|
|
+ { name: 'bicycles', url: '/assets/icons/bicycles.svg' },
|
|
|
+ { name: 'coffee-shop', url: '/assets/icons/coffee-shop1.svg' },
|
|
|
+ { name: 'mountain', url: '/assets/icons/mountain42.svg' },
|
|
|
+ { name: 'warning', url: '/assets/icons/warning.svg' },
|
|
|
],
|
|
|
popUpDisplay: 'hover',
|
|
|
default_layers: [
|
|
|
@@ -150,16 +156,29 @@ export class AppService {
|
|
|
sidebarClosed: true,
|
|
|
sidebarPosition: 'left',
|
|
|
});
|
|
|
- /* Now wait for the OpenLayers Map object to load */
|
|
|
- this.hsEventBusService.olMapLoads.subscribe(() => {
|
|
|
- /* ...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/ */
|
|
|
- }
|
|
|
- );
|
|
|
- })
|
|
|
+ /* Now wait for the OpenLayers Map object to load */
|
|
|
+ this.hsEventBusService.olMapLoads.subscribe(() => {
|
|
|
+ /* ...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.hsSidebarService.buttons.push({
|
|
|
+ panel: 'bc-panel',
|
|
|
+ module: '',
|
|
|
+ order: 3,
|
|
|
+ title: 'Blockchain panel',
|
|
|
+ description: 'Open blockchain panel',
|
|
|
+ icon: 'icon-link'
|
|
|
+ });
|
|
|
+
|
|
|
+ this.hsPanelContainerService.create(BcInfoComponent, {});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|