File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -1528,6 +1528,11 @@ function makeImageLayer(layerObj) {
15281528 'variables.image'
15291529 )
15301530
1531+ const hideNoDataValue = F_ . getIn (
1532+ L_ . layers . data [ layerObj . name ] ,
1533+ 'variables.hideNoDataValue'
1534+ )
1535+
15311536 let min = null
15321537 let max = null
15331538 if ( georaster . numberOfRasters === 1 ) {
@@ -1608,10 +1613,15 @@ function makeImageLayer(layerObj) {
16081613 var pixelValue = values [ 0 ] // single band
16091614 // don't return a color
16101615 if (
1611- georaster . noDataValue &&
1616+ georaster . noDataValue != null &&
16121617 georaster . noDataValue === pixelValue
16131618 ) {
1614- return null
1619+ if ( hideNoDataValue ) {
1620+ return null
1621+ }
1622+
1623+ // Handle the case where we do not want to hide noDataValue
1624+ return [ 0 , 0 , 0 ]
16151625 }
16161626
16171627 // scale from 0 - 1
Original file line number Diff line number Diff line change @@ -2292,14 +2292,28 @@ function interfaceWithMMGIS(fromInit) {
22922292 layerData . cogColormap
22932293 )
22942294
2295+ const hideNoDataValue = F_ . getIn (
2296+ L_ . layers . data [ layerName ] ,
2297+ 'variables.hideNoDataValue'
2298+ )
2299+
22952300 let pixelValuesToColorFn = ( values ) => {
22962301 let georaster = layer . options . georaster
22972302 var pixelValue = values [ 0 ] // single band
22982303
22992304 // don't return a color
2300- if ( georaster . noDataValue && georaster . noDataValue === pixelValue ) {
2301- return null
2305+ if (
2306+ georaster . noDataValue != null &&
2307+ georaster . noDataValue === pixelValue
2308+ ) {
2309+ if ( hideNoDataValue ) {
2310+ return null
2311+ }
2312+
2313+ // Handle the case where we do not want to hide noDataValue
2314+ return [ 0 , 0 , 0 ]
23022315 }
2316+
23032317 // scale from 0 - 1
23042318 var scaledPixelValue = ( pixelValue - vMin ) / range
23052319 if ( ! ( scaledPixelValue >= 0 && scaledPixelValue <= 1 ) ) {
You can’t perform that action at this time.
0 commit comments