<?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 Widget for Sentinel-2 date filtering in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1310874#M7680</link>
    <description>&lt;P&gt;I'm creating a new project in ArcGIS Experience Builder and one of the main things it needs is Sentinel-2 integration. We need not only the "latest" imagery (or whatever is loaded by default), but also the ability to manually select the date that is shown.&lt;/P&gt;&lt;P&gt;Currently, I've written a widget that I'm just using for debugging purposes. The webmap that is shown has a Sentinel-2 image service (from ESRI, using my ArcGIS Online credentials). The Sentinel-2 view itself can be found at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=fd61b9e0c69c4e14bebd50a9a968348c" rel="nofollow noreferrer" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=fd61b9e0c69c4e14bebd50a9a968348c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, ESRI has yet to implement support for image services in Experience Builder. Normally a layer like that would be registered as "time-enabled" and be able to have a timeline widget associated with it, sorting everything out without any code whatsoever. Unfortunately, we don't have that luxury, and I'm trying to do it in code.&lt;/P&gt;&lt;P&gt;This is my widget's runtime code so far, trying to pick up the data. It should be noted that field 9 is the "acquisitionDate" field, which is the one I would want to alter:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { React, AllWidgetProps } from 'jimu-core'
import { JimuMapViewComponent, JimuMapView } from 'jimu-arcgis'
const { useState } = React

const Widget = (props: AllWidgetProps&amp;lt;any&amp;gt;) =&amp;gt; {
  const [jimuMapView, setJimuMapView] = useState&amp;lt;JimuMapView&amp;gt;()

  const activeViewChangeHandler = (jmv: JimuMapView) =&amp;gt; {
    if (jmv) {
      setJimuMapView(jmv)
    }
  }

  const formSubmit = (evt) =&amp;gt; {
    evt.preventDefault()
    console.log('Some stuff here')
    console.log(jimuMapView.jimuLayerViews)
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").visible)
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968"))
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").fields[9])
    jimuMapView.view.map.findLayerById("Sentinel2_2968").visible = true    
  }
  
  return (
    &amp;lt;div className="widget-starter jimu-widget"&amp;gt;
      {
        props.useMapWidgetIds &amp;amp;&amp;amp;
        props.useMapWidgetIds.length === 1 &amp;amp;&amp;amp; (
          &amp;lt;JimuMapViewComponent
            useMapWidgetId={props.useMapWidgetIds?.[0]}
            onActiveViewChange={activeViewChangeHandler}
          /&amp;gt;
        )
      }

      &amp;lt;form onSubmit={formSubmit}&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;button&amp;gt;Debug&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/form&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Widget
&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 24 Jul 2023 05:56:33 GMT</pubDate>
    <dc:creator>MichaelBell</dc:creator>
    <dc:date>2023-07-24T05:56:33Z</dc:date>
    <item>
      <title>Widget for Sentinel-2 date filtering</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1310874#M7680</link>
      <description>&lt;P&gt;I'm creating a new project in ArcGIS Experience Builder and one of the main things it needs is Sentinel-2 integration. We need not only the "latest" imagery (or whatever is loaded by default), but also the ability to manually select the date that is shown.&lt;/P&gt;&lt;P&gt;Currently, I've written a widget that I'm just using for debugging purposes. The webmap that is shown has a Sentinel-2 image service (from ESRI, using my ArcGIS Online credentials). The Sentinel-2 view itself can be found at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=fd61b9e0c69c4e14bebd50a9a968348c" rel="nofollow noreferrer" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=fd61b9e0c69c4e14bebd50a9a968348c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, ESRI has yet to implement support for image services in Experience Builder. Normally a layer like that would be registered as "time-enabled" and be able to have a timeline widget associated with it, sorting everything out without any code whatsoever. Unfortunately, we don't have that luxury, and I'm trying to do it in code.&lt;/P&gt;&lt;P&gt;This is my widget's runtime code so far, trying to pick up the data. It should be noted that field 9 is the "acquisitionDate" field, which is the one I would want to alter:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { React, AllWidgetProps } from 'jimu-core'
import { JimuMapViewComponent, JimuMapView } from 'jimu-arcgis'
const { useState } = React

const Widget = (props: AllWidgetProps&amp;lt;any&amp;gt;) =&amp;gt; {
  const [jimuMapView, setJimuMapView] = useState&amp;lt;JimuMapView&amp;gt;()

  const activeViewChangeHandler = (jmv: JimuMapView) =&amp;gt; {
    if (jmv) {
      setJimuMapView(jmv)
    }
  }

  const formSubmit = (evt) =&amp;gt; {
    evt.preventDefault()
    console.log('Some stuff here')
    console.log(jimuMapView.jimuLayerViews)
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").visible)
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968"))
    console.log(jimuMapView.view.map.findLayerById("Sentinel2_2968").fields[9])
    jimuMapView.view.map.findLayerById("Sentinel2_2968").visible = true    
  }
  
  return (
    &amp;lt;div className="widget-starter jimu-widget"&amp;gt;
      {
        props.useMapWidgetIds &amp;amp;&amp;amp;
        props.useMapWidgetIds.length === 1 &amp;amp;&amp;amp; (
          &amp;lt;JimuMapViewComponent
            useMapWidgetId={props.useMapWidgetIds?.[0]}
            onActiveViewChange={activeViewChangeHandler}
          /&amp;gt;
        )
      }

      &amp;lt;form onSubmit={formSubmit}&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;button&amp;gt;Debug&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/form&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Widget
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jul 2023 05:56:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1310874#M7680</guid>
      <dc:creator>MichaelBell</dc:creator>
      <dc:date>2023-07-24T05:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Widget for Sentinel-2 date filtering</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1310957#M7684</link>
      <description>&lt;P&gt;It looks like you aren't getting jimuMapView from the MapViewManager. The syntax I usually use is:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const viewManager = MapViewManager.getInstance()
const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])
const [jimuMapView, setJimuMapView] = useState&amp;lt;JimuMapView&amp;gt;(mapView)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will also need to add MapViewManager to your imports on line 2.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 12:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1310957#M7684</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-07-24T12:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Widget for Sentinel-2 date filtering</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1330098#M8373</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-experience-builder-ideas/widget-for-image-services-and-date-filtering/idi-p/1330096/jump-to/first-unread-message" target="_self"&gt;I have added this to the idea board here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Having a built in widget in EB for time enabled imagery services would be so helpful!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 13:21:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/widget-for-sentinel-2-date-filtering/m-p/1330098#M8373</guid>
      <dc:creator>MeganEngel</dc:creator>
      <dc:date>2023-09-19T13:21:13Z</dc:date>
    </item>
  </channel>
</rss>

