import { Location } from '@angular/common'; import { Component, Inject, Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { ItemTypeService, commonReducers } from '@farmmaps/common'; import { Store } from '@ngrx/store'; import * as mapActions from '../../actions/map.actions'; import * as mapReducers from '../../reducers/map.reducer'; import { ForItemType } from '../for-item/for-itemtype.decorator'; import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component'; @ForItemType("vnd.farmmaps.itemtype.geotiff.processed") @Injectable() @Component({ selector: 'fm-map-selected-item-geotiff', templateUrl: './selected-item-geotiff.component.html', styleUrls: ['./selected-item-geotiff.component.scss'] }) export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent { constructor(store: Store, @Inject('itemTypeService') itemTypeService: ItemTypeService, location: Location, router: Router) { super(store, itemTypeService,location,router); } onLayerChanged(layerIndex: number) { this.store.dispatch(new mapActions.SetLayerIndex(layerIndex)); } layer(layers:any,layerIndex:number) { return layers.find(l => l.index == layerIndex); } }