Select to view content in your preferred language

Refreshing an Imagery Layer

07-24-2023 06:51 PM
New Contributor III

I'm currently adjusting an Imagery Layer's mosaicRule using a widget. I can set it, but I don't seem to be able to refresh the Imagery Layer so it shows what I want it to show - it just continues showing the same image with no change. Code is:

    let mosaicRule = new MosaicRule({
      where: "acquisitiondate >= '2023-06-18' AND acquisitiondate <= '2023-06-22'"
    });"Sentinel2_2968").mosaicRule = mosaicRule;

Something I CAN do is apply this same mosaicRule to a new layer and add that to the map - however I'd really not like to have to go through the map and find the layer, destroy it, and add a new one every time the user wants to make this change:

    let mosaicRule = new MosaicRule({
      where: "acquisitiondate >= '2023-06-18' AND acquisitiondate <= '2023-06-22'"
    const layer = new ImageryLayer ({
      url: "",
      format: "jpgpng"
    layer.mosaicRule = mosaicRule

Any idea how I can refresh the existing layer rather than having to create it all over again every time we change anything?

0 Kudos
0 Replies