@@ -722,85 +722,91 @@ const getComponent = (
722722 ) ;
723723
724724 let domain =
725- window . mmgisglobal . NODE_ENV === "development"
726- ? "http://localhost:8888/"
727- : window . mmgisglobal . ROOT_PATH || "" ;
725+ window . mmgisglobal . NODE_ENV === "development"
726+ ? "http://localhost:8888/"
727+ : window . mmgisglobal . ROOT_PATH || "" ;
728728 if ( domain . length > 0 && ! domain . endsWith ( "/" ) ) domain += "/" ;
729729
730- let colormap_html
730+ let colormap_html ;
731731 if ( window . mmgisglobal . WITH_TITILER === "true" ) {
732732 // Get colors from TiTiler if it is available
733733 colormap_html = (
734- < div style = { { width : "100%" } } >
735- < img id = "titlerCogColormapImage" style = { { height : "20px" , width : "100%" } } src = { `${ domain } titiler/colorMaps/${ dropdown_value . toLowerCase ( ) } ?format=png` } />
734+ < div style = { { width : "100%" } } >
735+ < img
736+ id = "titlerCogColormapImage"
737+ style = { { height : "20px" , width : "100%" } }
738+ src = { `${ domain } titiler/colorMaps/${ dropdown_value . toLowerCase ( ) } ?format=png` }
739+ />
736740 </ div >
737- )
741+ ) ;
738742 } else {
739- let colormap = dropdown_value
743+ let colormap = dropdown_value ;
740744 // js-colormaps data object only contains the non reversed color so we need to track if the color is reversed
741- let reverse = false
745+ let reverse = false ;
742746
743747 // TiTiler colormap variables are all lower case so we need to format them correctly for js-colormaps
744- if ( colormap . toLowerCase ( ) . endsWith ( '_r' ) ) {
745- colormap = colormap . substring ( 0 , colormap . length - 2 )
746- reverse = true
748+ if ( colormap . toLowerCase ( ) . endsWith ( "_r" ) ) {
749+ colormap = colormap . substring ( 0 , colormap . length - 2 ) ;
750+ reverse = true ;
747751 }
748752
749- let index = Object . keys ( colormapData ) . findIndex ( v => {
753+ let index = Object . keys ( colormapData ) . findIndex ( ( v ) => {
750754 return v . toLowerCase ( ) === colormap . toLowerCase ( ) ;
751755 } ) ;
752756
753757 if ( index > - 1 ) {
754- colormap = Object . keys ( colormapData ) [ index ]
758+ colormap = Object . keys ( colormapData ) [ index ] ;
755759 } else {
756760 console . warn ( `The colormap '${ colormap } ' does not exist` ) ;
757761 }
758762
759763 if ( colormap in colormapData ) {
760- colormap_html = colormapData [ colormap ] . colors . map (
761- ( hex ) => {
762- return (
763- < div
764- className = { c . colorDropdownArrayHex }
765- style = { { background : `rgb(${ hex . map ( v => { return Math . floor ( v * 255 ) } ) . join ( ',' ) } )` } }
766- > </ div >
767- ) ;
768- }
769- )
764+ colormap_html = colormapData [ colormap ] . colors . map ( ( hex ) => {
765+ return (
766+ < div
767+ className = { c . colorDropdownArrayHex }
768+ style = { {
769+ background : `rgb(${ hex
770+ . map ( ( v ) => {
771+ return Math . floor ( v * 255 ) ;
772+ } )
773+ . join ( "," ) } )`,
774+ } }
775+ > </ div >
776+ ) ;
777+ } ) ;
770778
771779 if ( reverse === true ) {
772- colormap_html . reverse ( )
780+ colormap_html . reverse ( ) ;
773781 }
774- } else if ( colormap === ' DEFAULT' ) {
782+ } else if ( colormap === " DEFAULT" ) {
775783 // Default color for velocity layer
776784 const defaultColors = [
777- ' rgb(36,104, 180)' ,
778- ' rgb(60,157, 194)' ,
779- ' rgb(128,205,193 )' ,
780- ' rgb(151,218,168 )' ,
781- ' rgb(198,231,181)' ,
782- ' rgb(238,247,217)' ,
783- ' rgb(255,238,159)' ,
784- ' rgb(252,217,125)' ,
785- ' rgb(255,182,100)' ,
786- ' rgb(252,150,75)' ,
787- ' rgb(250,112,52)' ,
788- ' rgb(245,64,32)' ,
789- ' rgb(237,45,28)' ,
790- ' rgb(220,24,32)' ,
791- ' rgb(180,0,35)' ,
792- ]
785+ " rgb(36,104, 180)" ,
786+ " rgb(60,157, 194)" ,
787+ " rgb(128,205,193 )" ,
788+ " rgb(151,218,168 )" ,
789+ " rgb(198,231,181)" ,
790+ " rgb(238,247,217)" ,
791+ " rgb(255,238,159)" ,
792+ " rgb(252,217,125)" ,
793+ " rgb(255,182,100)" ,
794+ " rgb(252,150,75)" ,
795+ " rgb(250,112,52)" ,
796+ " rgb(245,64,32)" ,
797+ " rgb(237,45,28)" ,
798+ " rgb(220,24,32)" ,
799+ " rgb(180,0,35)" ,
800+ ] ;
793801
794- colormap_html = defaultColors . map (
795- ( hex ) => {
796- return (
797- < div
798- className = { c . colorDropdownArrayHex }
799- style = { { background : `${ hex } ` } }
800- > </ div >
801- ) ;
802- }
803- )
802+ colormap_html = defaultColors . map ( ( hex ) => {
803+ return (
804+ < div
805+ className = { c . colorDropdownArrayHex }
806+ style = { { background : `${ hex } ` } }
807+ > </ div >
808+ ) ;
809+ } ) ;
804810 }
805811 }
806812
@@ -809,9 +815,7 @@ const getComponent = (
809815 { inlineHelp ? (
810816 < >
811817 { inner }
812- < div className = { c . textArrayHexes } >
813- { colormap_html || null }
814- </ div >
818+ < div className = { c . textArrayHexes } > { colormap_html || null } </ div >
815819 < Typography className = { c . subtitle2 } >
816820 { com . description || "" }
817821 </ Typography >
0 commit comments