diff --git a/projects/common-map/src/fm-map/components/aol/layer-list/layer-list.component.ts b/projects/common-map/src/fm-map/components/aol/layer-list/layer-list.component.ts index f0acb6d..4f90e86 100644 --- a/projects/common-map/src/fm-map/components/aol/layer-list/layer-list.component.ts +++ b/projects/common-map/src/fm-map/components/aol/layer-list/layer-list.component.ts @@ -1,64 +1,64 @@ -import { Component,Input,Output,EventEmitter } from '@angular/core'; -import { IItemLayer } from '../../../models/item.layer'; - -@Component({ - selector: 'fm-map-layer-list', - templateUrl: './layer-list.component.html', - styleUrls: ['./layer-list.component.scss'] -}) - -export class LayerListComponent { - @Input() itemLayers: IItemLayer[]; - @Input() baseLayers: boolean = false; - @Output() onToggleVisibility = new EventEmitter(); - @Output() onSetOpacity = new EventEmitter<{layer: IItemLayer,opacity:number }>(); - @Output() onDelete = new EventEmitter(); - @Output() onZoomToExtent = new EventEmitter(); - @Output() onSelectLayer = new EventEmitter(); - @Input() selectedLayer: IItemLayer; - - constructor( ) { - } - - handleDelete(event:MouseEvent, item:IItemLayer) { - this.onDelete.emit(item); - event.preventDefault(); - } - - handleToggleVisibility(event:MouseEvent, item: IItemLayer) { - this.onToggleVisibility.emit(item); - item.legendVisible = item.visible && item.legendVisible; - event.preventDefault(); - } - - handleSetOpacity(event: MouseEvent, layer: IItemLayer,opacity:number) { - this.onSetOpacity.emit({ layer,opacity }); - event.preventDefault(); - } - - handleZoomToExtent(event: MouseEvent, item: IItemLayer) { - this.onZoomToExtent.emit(item); - event.preventDefault(); - } - - handleSelectLayer(event: MouseEvent, item: IItemLayer) { - this.onSelectLayer.emit(item); - event.preventDefault(); - } - - firstLayer(item: IItemLayer): any { - if (item && item.item && item.item.data && item.item.data.layers && item.item.data.layers.length > 0) return item.item.data.layers[0]; - return null; - } - - toggleLegend(event: MouseEvent, lg: boolean) { - event.preventDefault(); - return !lg; - } - - handleLegendClick(event: MouseEvent, item: IItemLayer) { - this.onSelectLayer.emit(item); - this.onZoomToExtent.emit(item); - event.preventDefault(); - } -} +import { Component,Input,Output,EventEmitter } from '@angular/core'; +import { IItemLayer } from '../../../models/item.layer'; + +@Component({ + selector: 'fm-map-layer-list', + templateUrl: './layer-list.component.html', + styleUrls: ['./layer-list.component.scss'] +}) + +export class LayerListComponent { + @Input() itemLayers: IItemLayer[] = []; + @Input() baseLayers: boolean = false; + @Output() onToggleVisibility = new EventEmitter(); + @Output() onSetOpacity = new EventEmitter<{layer: IItemLayer,opacity:number }>(); + @Output() onDelete = new EventEmitter(); + @Output() onZoomToExtent = new EventEmitter(); + @Output() onSelectLayer = new EventEmitter(); + @Input() selectedLayer: IItemLayer; + + constructor( ) { + } + + handleDelete(event:MouseEvent, item:IItemLayer) { + this.onDelete.emit(item); + event.preventDefault(); + } + + handleToggleVisibility(event:MouseEvent, item: IItemLayer) { + this.onToggleVisibility.emit(item); + item.legendVisible = item.visible && item.legendVisible; + event.preventDefault(); + } + + handleSetOpacity(event: MouseEvent, layer: IItemLayer,opacity:number) { + this.onSetOpacity.emit({ layer,opacity }); + event.preventDefault(); + } + + handleZoomToExtent(event: MouseEvent, item: IItemLayer) { + this.onZoomToExtent.emit(item); + event.preventDefault(); + } + + handleSelectLayer(event: MouseEvent, item: IItemLayer) { + this.onSelectLayer.emit(item); + event.preventDefault(); + } + + firstLayer(item: IItemLayer): any { + if (item && item.item && item.item.data && item.item.data.layers && item.item.data.layers.length > 0) return item.item.data.layers[0]; + return null; + } + + toggleLegend(event: MouseEvent, lg: boolean) { + event.preventDefault(); + return !lg; + } + + handleLegendClick(event: MouseEvent, item: IItemLayer) { + this.onSelectLayer.emit(item); + this.onZoomToExtent.emit(item); + event.preventDefault(); + } +}