|
|
@@ -16,8 +16,9 @@ import {HsSidebarService} from 'hslayers-ng/components/sidebar/sidebar.service';
|
|
|
|
|
|
import {AdjusterComponent} from './adjuster/adjuster.component';
|
|
|
import {AdjusterEventService} from './adjuster/adjuster-event.service';
|
|
|
+import {AdjusterLegendService} from './adjuster/adjuster-legend.service';
|
|
|
import {AdjusterService} from './adjuster/adjuster.service';
|
|
|
-import {krajeLayer, obce, obceIndexLayer, okresyLayer} from './app.config';
|
|
|
+import {krajeLayer, obceIndexLayer, okresyLayer} from './app.config';
|
|
|
|
|
|
@Injectable({providedIn: 'root'})
|
|
|
export class AppService {
|
|
|
@@ -40,6 +41,7 @@ export class AppService {
|
|
|
constructor(
|
|
|
public adjusterService: AdjusterService,
|
|
|
public adjusterEventService: AdjusterEventService,
|
|
|
+ public adjusterLegendService: AdjusterLegendService,
|
|
|
public hsConfig: HsConfig,
|
|
|
public hsEventBus: HsEventBusService,
|
|
|
public hsLanguageService: HsLanguageService,
|
|
|
@@ -106,9 +108,11 @@ export class AppService {
|
|
|
// obceIndexLayer, okresyLayer and krajeLayer must be pushed in this order
|
|
|
// so they will display in correct order
|
|
|
this.hsConfig.default_layers.push(obceIndexLayer);
|
|
|
+ obceIndexLayer.on('featuresloadend', this.adjusterService.init());
|
|
|
+ const indexLegend = this.adjusterLegendService.createIndexLegend();
|
|
|
+ obceIndexLayer.getSource().legend_categories = indexLegend;
|
|
|
this.hsConfig.default_layers.push(okresyLayer);
|
|
|
this.hsConfig.default_layers.push(krajeLayer);
|
|
|
- obceIndexLayer.on('featuresloadend', this.adjusterService.init());
|
|
|
}
|
|
|
|
|
|
/**
|