georaster-layer-for-leaflet icon indicating copy to clipboard operation
georaster-layer-for-leaflet copied to clipboard

disable animation

Open shinnobi opened this issue 1 year ago • 6 comments

Hi !

i need to load multiple file tiff (24 file) then i play it (with interval 2s then next to next tiff ) my approach is:

  1. try pre-loading 24 tiff file to GeoRasterLayer
  2. then add/remove layers to the map when event interval

it's work so good but there is some animation when add new layer, how can stop it,

///add to georasterlayer
var layer = new GeoRasterLayer({
        pane: isRadar ? "pane460" : "pane450",
        georaster: georaster,
        opacity: 1,
        pixelValuesToColorFn: function (pixelValues) {
          var pixelValue = pixelValues[0]; // there's just one band in this raster
          if (pixelValue === 0 || pixelValue === -999.0) return null;
          var color = isRadar
            ? radar(pixelValue).hex()
            : satellite(pixelValue).hex();
          return color;
        },
        resolution: 256,
      });
      return { filename: filename, layer: layer };
    }


////add to layer group
    this.sateLayer.clearLayers();
    this.radarLayerGroup.clearLayers();
 if (satelliteLayer.layer) {
      satelliteLayer.layer.addTo(this.sateLayer);
      satelliteLayer.layer.setZIndex(1);   
    }

2022-12-26-11-28-44

shinnobi avatar Dec 16 '22 04:12 shinnobi