updateTilesRendering (visuParamChanged, zoomLevel, tilesCoordRanges) {
    // rerender tiles already loaded
    // retrieve all the cached tiles from the raster source and reapply the offscreen render
    let mapRerender = false
    for (const [key, value] of Object.entries(this.rasterSource.tileCache.entries_)) {
      const tile = value.value_
      const z = tile.tileCoord[0] // integer
      const y = tile.tileCoord[1]
      const x = tile.tileCoord[2]
      // for perfomances reasons we refresh only the tiles that are currently
      // at the same zoom level and extent of the view. The other tiles will be updated
      // interactively when zooming or panning the view.
      let render = false
      let update = Math.abs(z - zoomLevel) < 0.75
      if (tilesCoordRanges) {
        update = update &&
          (y >= tilesCoordRanges[1].min && y <= tilesCoordRanges[1].max) &&
          (x >= tilesCoordRanges[0].min && x <= tilesCoordRanges[0].max)
      }
      if (update) {
        if (visuParamChanged) {
          render = true
        } else {
          render = tile.needToRerender === true && tile.isLoading !== true
        }
      } else if (visuParamChanged) {
        tile.needToRerender = true
      }

      if (render) {
        console.log('updating rendering for tile : ', key)
        const samplesPerPixel = this.pyramidMetadata[z].SamplesPerPixel // number of colors for pixel
        if (samplesPerPixel === 1) {
          const columns = this.pyramidMetadata[z].Columns
          const rows = this.pyramidMetadata[z].Rows
          const { thresholdValues, limitValues, color } = this.blendingInformation
          const img = tile.getImage()

          // coloring images
          const frameData = {
            img,
            thresholdValues,
            limitValues,
            color,
            opacity: 1, // handled by OpenLayers
            columns,
            rows
          }

          this.renderingEngine.colorMonochromeImageFrame(frameData)
          mapRerender = true
          tile.needToRerender = false
        }
      }
    }

    return mapRerender
  }
/** Reruns the offscreen render to color the tiles if needed.
   * This is called at every zoom interaction.
   * @param {boolean} visuParamChanged - true if this is called by setBlendingInformation
   * @param {number} zoomLevel - zoom level to update
   * @param {number[]} tilesCoordRanges - array with tiles X and Y coordinates ranges to update
   *
   * @returns {boolean} rerender - force OpenLayer to rerender the view.
  */
Reruns the offscreen render to color the tiles if needed.
This is called at every zoom interaction.
@param {boolean} visuParamChanged - true if this is called by setBlendingInformation
@param {number} zoomLevel - zoom level to update
@param {number[]} tilesCoordRanges - array with tiles X and Y coordinates ranges to update

@returns {boolean} rerender - force OpenLayer to rerender the view.
Reruns the offscreen render to color the tiles if needed . This is called at every zoom interaction . @param { boolean } visuParamChanged - true if this is called by setBlendingInformation @param { number } zoomLevel - zoom level to update @param { number [] } tilesCoordRanges - array with tiles X and Y coordinates ranges to update @returns { boolean } rerender - force OpenLayer to rerender the view .
updateTilesRendering (visuParamChanged, zoomLevel, tilesCoordRanges) {
    let mapRerender = false
    for (const [key, value] of Object.entries(this.rasterSource.tileCache.entries_)) {
      const tile = value.value_
      const z = tile.tileCoord[0] 
      const y = tile.tileCoord[1]
      const x = tile.tileCoord[2]
      let render = false
      let update = Math.abs(z - zoomLevel) < 0.75
      if (tilesCoordRanges) {
        update = update &&
          (y >= tilesCoordRanges[1].min && y <= tilesCoordRanges[1].max) &&
          (x >= tilesCoordRanges[0].min && x <= tilesCoordRanges[0].max)
      }
      if (update) {
        if (visuParamChanged) {
          render = true
        } else {
          render = tile.needToRerender === true && tile.isLoading !== true
        }
      } else if (visuParamChanged) {
        tile.needToRerender = true
      }
      if (render) {
        console.log('updating rendering for tile : ', key)
        const samplesPerPixel = this.pyramidMetadata[z].SamplesPerPixel 
        if (samplesPerPixel === 1) {
          const columns = this.pyramidMetadata[z].Columns
          const rows = this.pyramidMetadata[z].Rows
          const { thresholdValues, limitValues, color } = this.blendingInformation
          const img = tile.getImage()
          const frameData = {
            img,
            thresholdValues,
            limitValues,
            color,
            opacity: 1, 
            columns,
            rows
          }
          this.renderingEngine.colorMonochromeImageFrame(frameData)
          mapRerender = true
          tile.needToRerender = false
        }
      }
    }
    return mapRerender
  }
updateTilesRendering ( visuParamChanged , zoomLevel , tilesCoordRanges ) { let mapRerender = false for ( const [ key , value ] of Object . entries ( this . rasterSource . tileCache . entries_ ) ) { const tile = value . value_ const z = tile . tileCoord [ 0 ] const y = tile . tileCoord [ 1 ] const x = tile . tileCoord [ 2 ] let render = false let update = Math . abs ( z - zoomLevel ) < 0.75 if ( tilesCoordRanges ) { update = update && ( y >= tilesCoordRanges [ 1 ] . min && y <= tilesCoordRanges [ 1 ] . max ) && ( x >= tilesCoordRanges [ 0 ] . min && x <= tilesCoordRanges [ 0 ] . max ) } if ( update ) { if ( visuParamChanged ) { render = true } else { render = tile . needToRerender === true && tile . isLoading !== true } } else if ( visuParamChanged ) { tile . needToRerender = true } if ( render ) { console . log ( 'updating rendering for tile : ' , key ) const samplesPerPixel = this . pyramidMetadata [ z ] . SamplesPerPixel if ( samplesPerPixel === 1 ) { const columns = this . pyramidMetadata [ z ] . Columns const rows = this . pyramidMetadata [ z ] . Rows const { thresholdValues , limitValues , color } = this . blendingInformation const img = tile . getImage ( ) const frameData = { img , thresholdValues , limitValues , color , opacity : 1 , columns , rows } this . renderingEngine . colorMonochromeImageFrame ( frameData ) mapRerender = true tile . needToRerender = false } } } return mapRerender }
Reruns the offscreen render to color the tiles if needed.
Reruns the offscreen render to color the tiles if needed .
// rerender tiles already loaded // retrieve all the cached tiles from the raster source and reapply the offscreen render // integer // for perfomances reasons we refresh only the tiles that are currently // at the same zoom level and extent of the view. The other tiles will be updated // interactively when zooming or panning the view. // number of colors for pixel // coloring images // handled by OpenLayers