import { DyfiResponseOverlay } from '@shared/map-overlay/dyfi-response-overlay' ; import { Pipe , PipeTransform } from '@angular/core' ; import * as L from 'leaflet' ; @ Pipe ( { name : 'dyfiOverlays' } ) export class DyfiOverlaysPipe implements PipeTransform { param product returns transform ( product ) { const overlays = [ ] ; if ( product && product . contents ) { if ( product . contents [ 'dyfi_geo_1km.geojson' ] ) { overlays . push ( new DyfiResponseOverlay ( product , 1 ) ) ; } if ( product . contents [ 'dyfi_geo_10km.geojson' ] ) { overlays . push ( new DyfiResponseOverlay ( product , 10 ) ) ; } } return overlays ; } }