import { AsynchronousGeoJSONOverlay } from './asynchronous-geojson-overlay' ; /**
 * Shakemaop intensity overlay for leaflet map
 */ const ShakemapMmiOverlay = AsynchronousGeoJSONOverlay . extend ( { id : 'shakemap-mmi-contours' , legends : [ ] , title : 'Shakemap MMI Contours' , param product initialize : function ( product ) { AsynchronousGeoJSONOverlay . prototype . initialize . call ( this ) ; const intensityLegend = document . createElement ( 'img' ) ; intensityLegend . src = './assets/shakemap-intensity-legend-small.png' ; intensityLegend . setAttribute ( 'alt' , 'Intensity Scale legend' ) ; const contourLegend = document . createElement ( 'img' ) ; contourLegend . src = './assets/legend-intensity-contour.png' ; contourLegend . setAttribute ( 'alt' , 'Intensity Contour Legend' ) ; this . legends . push ( intensityLegend , contourLegend ) ; this . url = this . getUrl ( product ) ; } , param product getUrl : function ( product ) { if ( product === null ) { return null ; } return product . contents [ 'download/cont_mi.json' ] ? product . contents [ 'download/cont_mi.json' ] . url : null ; } , param feature param layer onEachFeature : function ( feature , layer ) { if ( feature . properties ) { layer . bindPopup ( `<abbr title="Modified Mercalli Intensity">MMI</abbr>
      ${ feature . properties . value }` ) ; } } , param feature style : function ( feature ) { const lineStyle = { color : feature . properties . color , opacity : 1 , weight : feature . properties . weight } ; return lineStyle ; } } ) ; export { ShakemapMmiOverlay } ;