diff --git a/projects/common/src/lib/services/itemtype.service.ts b/projects/common/src/lib/services/itemtype.service.ts index 558e126..5304bb1 100644 --- a/projects/common/src/lib/services/itemtype.service.ts +++ b/projects/common/src/lib/services/itemtype.service.ts @@ -6,30 +6,34 @@ import {IItem} from '../models/item' @Injectable() export class ItemTypeService { - private _itemTypes: IItemTypes; + public itemTypes: IItemTypes; constructor(private store: Store ) { this.store.select(appCommonReducer.selectGetItemTypes).subscribe((itemTypes) => { - this._itemTypes = itemTypes; + this.itemTypes = itemTypes; }); } getIcon(itemType: string) { var icon = "fa-file-o"; - if (this._itemTypes[itemType]) icon = this._itemTypes[itemType].icon; + if (this.itemTypes[itemType]) icon = this.itemTypes[itemType].icon; return icon; } getColor(itemType: string) { var color = "#000000"; - if (this._itemTypes[itemType]) color = this._itemTypes[itemType].iconColor; + if (this.itemTypes[itemType]) color = this.itemTypes[itemType].iconColor; return color; } hasViewer(item: IItem) { let itemType: string = item.itemType; - if (this._itemTypes[itemType]) return this._itemTypes[itemType].viewer !== undefined; + if (this.itemTypes[itemType]) return this.itemTypes[itemType].viewer !== undefined; return false; } - + + isLayer(item: IItem) { + let itemType: string = item.itemType; + return itemType == "vnd.farmmaps.itemtype.geotiff.processed" || itemType == "vnd.farmmaps.itemtype.layer" || itemType == "vnd.farmmaps.itemtype.shape.processed"; + } } \ No newline at end of file