<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Refreshing an Imagery Layer in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/refreshing-an-imagery-layer/m-p/1311357#M7691</link>
    <description>&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    let mosaicRule = new MosaicRule({
      where: "acquisitiondate &amp;gt;= '2023-06-18' AND acquisitiondate &amp;lt;= '2023-06-22'"
    });
    jimuMapView.view.map.findLayerById("Sentinel2_2968").mosaicRule = mosaicRule;
   
 console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").mosaicRule)
    jimuMapView.view.map.findLayerById("Sentinel2_2968").refresh();&lt;/LI-CODE&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    let mosaicRule = new MosaicRule({
      where: "acquisitiondate &amp;gt;= '2023-06-18' AND acquisitiondate &amp;lt;= '2023-06-22'"
    });
    const layer = new ImageryLayer ({
      url: "https://myserver.com/portal/sharing/servers/itemid/rest/services/Sentinel2/ImageServer",
      format: "jpgpng"
    })
    layer.mosaicRule = mosaicRule
    jimuMapView.view.map.add(layer)&lt;/LI-CODE&gt;&lt;P&gt;Any idea how I can refresh the existing layer rather than having to create it all over again every time we change anything?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2023 01:51:16 GMT</pubDate>
    <dc:creator>MichaelBell</dc:creator>
    <dc:date>2023-07-25T01:51:16Z</dc:date>
    <item>
      <title>Refreshing an Imagery Layer</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/refreshing-an-imagery-layer/m-p/1311357#M7691</link>
      <description>&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    let mosaicRule = new MosaicRule({
      where: "acquisitiondate &amp;gt;= '2023-06-18' AND acquisitiondate &amp;lt;= '2023-06-22'"
    });
    jimuMapView.view.map.findLayerById("Sentinel2_2968").mosaicRule = mosaicRule;
   
 console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").mosaicRule)
    jimuMapView.view.map.findLayerById("Sentinel2_2968").refresh();&lt;/LI-CODE&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    let mosaicRule = new MosaicRule({
      where: "acquisitiondate &amp;gt;= '2023-06-18' AND acquisitiondate &amp;lt;= '2023-06-22'"
    });
    const layer = new ImageryLayer ({
      url: "https://myserver.com/portal/sharing/servers/itemid/rest/services/Sentinel2/ImageServer",
      format: "jpgpng"
    })
    layer.mosaicRule = mosaicRule
    jimuMapView.view.map.add(layer)&lt;/LI-CODE&gt;&lt;P&gt;Any idea how I can refresh the existing layer rather than having to create it all over again every time we change anything?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 01:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/refreshing-an-imagery-layer/m-p/1311357#M7691</guid>
      <dc:creator>MichaelBell</dc:creator>
      <dc:date>2023-07-25T01:51:16Z</dc:date>
    </item>
  </channel>
</rss>

