Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/essence/Basics/Map_/Map_.js
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,11 @@ function makeImageLayer(layerObj) {
'variables.image'
)

const hideNoDataValue = F_.getIn(
L_.layers.data[layerObj.name],
'variables.hideNoDataValue'
)

let min = null
let max = null
if (georaster.numberOfRasters === 1) {
Expand Down Expand Up @@ -1608,10 +1613,15 @@ function makeImageLayer(layerObj) {
var pixelValue = values[0] // single band
// don't return a color
if (
georaster.noDataValue &&
georaster.noDataValue != null &&
georaster.noDataValue === pixelValue
) {
return null
if (hideNoDataValue) {
return null
}

// Handle the case where we do not want to hide noDataValue
return [0, 0, 0]
}

// scale from 0 - 1
Expand Down
18 changes: 16 additions & 2 deletions src/essence/Tools/Layers/LayersTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -2292,14 +2292,28 @@ function interfaceWithMMGIS(fromInit) {
layerData.cogColormap
)

const hideNoDataValue = F_.getIn(
L_.layers.data[layerName],
'variables.hideNoDataValue'
)

let pixelValuesToColorFn = (values) => {
let georaster = layer.options.georaster
var pixelValue = values[0] // single band

// don't return a color
if (georaster.noDataValue && georaster.noDataValue === pixelValue) {
return null
if (
georaster.noDataValue != null &&
georaster.noDataValue === pixelValue
) {
if (hideNoDataValue) {
return null
}

// Handle the case where we do not want to hide noDataValue
return [0, 0, 0]
}

// scale from 0 - 1
var scaledPixelValue = (pixelValue - vMin) / range
if (!(scaledPixelValue >= 0 && scaledPixelValue <= 1)) {
Expand Down