<?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 ExpB Map Widget (JimuMapViews container), JimuMapTools 'Select' Widget (how to monitor for changes?) in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1409798#M12086</link>
    <description>&lt;P&gt;Customizing ExpB 1.14 experience with a custom Widget.&lt;/P&gt;&lt;P&gt;Hello ExpB Dev community. I don't know if my issue is conceptual (understanding how the technologies work) or syntactical (where I am holding my tongue while I type).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bare Bones Question:&amp;nbsp; How do I set up a eventlistener/ReactiveUtil/ to capture the ExpB Map Widget when toggling between the WebMaps that were loaded in the Map Widget Settings?&lt;/P&gt;&lt;P&gt;I can get the individual Web Maps:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])
  const mapView2 = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[1])

&lt;/LI-CODE&gt;&lt;P&gt;I can query to see if mapView is active:&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;!&lt;/SPAN&gt;&lt;SPAN&gt;mapView&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;isActive&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I need to set new parameters as soon as the WebMap toggle happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I cannot get a ReactiveUtils or Eventlistener to fire when: mapView.isActive changes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Line 1 and Line 2 below works.&amp;nbsp; Line 3 does NOT work.&amp;nbsp; Does not error, just does nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    reactiveUtils.when(() =&amp;gt; mapView.view.interacting === true, () =&amp;gt; alert("Interacting True")); 
    reactiveUtils.when(() =&amp;gt; mapView.view.focused === false, () =&amp;gt; alert("MapView:focused= false"));
    reactiveUtils.when(() =&amp;gt; mapView.isActive === false, () =&amp;gt; alert("MapView:isActive = false"));&lt;/LI-CODE&gt;&lt;P&gt;Line 1 and line 2&amp;nbsp; fire from the mapView.view object (view has interacting, focused properties)&lt;/P&gt;&lt;P&gt;Line 3 JimuMapView has the isActive property, but does nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mapView is a JimuMapView object that has a 'isActive' property.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Longer explanation of task at hand.&lt;/P&gt;&lt;P&gt;I am constructing an experience (with custom widget) where the end user is supported with two different web Maps (with layers of information relating to the same location).&amp;nbsp; The operational layers (polygon layers)&amp;nbsp; for each WebMap are different.&amp;nbsp; The background layers are also different for each WebMap.&amp;nbsp; But the area of interest is basically the same (but the Map extent for each WebMap in the AOI is different).&lt;/P&gt;&lt;P&gt;I have configured the ExpB Map widget with the two WebMaps of interest.&amp;nbsp;This adds a toggle button down on the lower left of the Map. Upon each click the user can switch between WebMaps with the WebMaps Extent synced for each WebMap.&lt;/P&gt;&lt;P&gt;The above works just fine.&lt;/P&gt;&lt;P&gt;Within my Custom Widget I am wanting to capture/monitor/watch/addListener to the toggling of the loaded WebMap in order to set specific settings in the Application. An example of this is changing the Home-Button to set extent back to main AOI of whichever map is currently loaded.&lt;/P&gt;&lt;P&gt;Thanks for any thoughts and ideas.&lt;/P&gt;&lt;P&gt;BobinTN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2024 16:28:21 GMT</pubDate>
    <dc:creator>brundageb</dc:creator>
    <dc:date>2024-04-15T16:28:21Z</dc:date>
    <item>
      <title>ExpB Map Widget (JimuMapViews container), JimuMapTools 'Select' Widget (how to monitor for changes?)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1409798#M12086</link>
      <description>&lt;P&gt;Customizing ExpB 1.14 experience with a custom Widget.&lt;/P&gt;&lt;P&gt;Hello ExpB Dev community. I don't know if my issue is conceptual (understanding how the technologies work) or syntactical (where I am holding my tongue while I type).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bare Bones Question:&amp;nbsp; How do I set up a eventlistener/ReactiveUtil/ to capture the ExpB Map Widget when toggling between the WebMaps that were loaded in the Map Widget Settings?&lt;/P&gt;&lt;P&gt;I can get the individual Web Maps:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])
  const mapView2 = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[1])

&lt;/LI-CODE&gt;&lt;P&gt;I can query to see if mapView is active:&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;!&lt;/SPAN&gt;&lt;SPAN&gt;mapView&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;isActive&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I need to set new parameters as soon as the WebMap toggle happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I cannot get a ReactiveUtils or Eventlistener to fire when: mapView.isActive changes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Line 1 and Line 2 below works.&amp;nbsp; Line 3 does NOT work.&amp;nbsp; Does not error, just does nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    reactiveUtils.when(() =&amp;gt; mapView.view.interacting === true, () =&amp;gt; alert("Interacting True")); 
    reactiveUtils.when(() =&amp;gt; mapView.view.focused === false, () =&amp;gt; alert("MapView:focused= false"));
    reactiveUtils.when(() =&amp;gt; mapView.isActive === false, () =&amp;gt; alert("MapView:isActive = false"));&lt;/LI-CODE&gt;&lt;P&gt;Line 1 and line 2&amp;nbsp; fire from the mapView.view object (view has interacting, focused properties)&lt;/P&gt;&lt;P&gt;Line 3 JimuMapView has the isActive property, but does nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mapView is a JimuMapView object that has a 'isActive' property.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Longer explanation of task at hand.&lt;/P&gt;&lt;P&gt;I am constructing an experience (with custom widget) where the end user is supported with two different web Maps (with layers of information relating to the same location).&amp;nbsp; The operational layers (polygon layers)&amp;nbsp; for each WebMap are different.&amp;nbsp; The background layers are also different for each WebMap.&amp;nbsp; But the area of interest is basically the same (but the Map extent for each WebMap in the AOI is different).&lt;/P&gt;&lt;P&gt;I have configured the ExpB Map widget with the two WebMaps of interest.&amp;nbsp;This adds a toggle button down on the lower left of the Map. Upon each click the user can switch between WebMaps with the WebMaps Extent synced for each WebMap.&lt;/P&gt;&lt;P&gt;The above works just fine.&lt;/P&gt;&lt;P&gt;Within my Custom Widget I am wanting to capture/monitor/watch/addListener to the toggling of the loaded WebMap in order to set specific settings in the Application. An example of this is changing the Home-Button to set extent back to main AOI of whichever map is currently loaded.&lt;/P&gt;&lt;P&gt;Thanks for any thoughts and ideas.&lt;/P&gt;&lt;P&gt;BobinTN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 16:28:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1409798#M12086</guid>
      <dc:creator>brundageb</dc:creator>
      <dc:date>2024-04-15T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: ExpB Map Widget (JimuMapViews container), JimuMapTools 'Select' Widget (how to monitor for changes?)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1409808#M12088</link>
      <description>&lt;P&gt;Are you working with the&amp;nbsp;&lt;A href="https://developers.arcgis.com/experience-builder/api-reference/jimu-arcgis/JimuMapViewComponent/#JimuMapViewComponent" target="_self"&gt;JimuMapViewComponent&lt;/A&gt;&amp;nbsp;? The onActiveViewChange function should execute anytime the active mapView changes. You should be able to trigger your logic from within this function.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//This function should fire when changing mapViews.
const activeViewChangeHandler = (jmv: JimuMapView) =&amp;gt; {
		if (jmv) {
			setJimuMapView(jmv)
		}
	}

    return (
		&amp;lt;div className='jimu-widget'
			{
				...
				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;gt;
		&amp;lt;/div&amp;gt;
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 16:49:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1409808#M12088</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-04-15T16:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: ExpB Map Widget (JimuMapViews container), JimuMapTools 'Select' Widget (how to monitor for changes?)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1411192#M12140</link>
      <description>&lt;P&gt;I appreciate your support Mr. Thompson.&amp;nbsp; JimuMapViewComponent onActiveViewChange is firing when the Active MapView is changed. Thank you.&lt;/P&gt;&lt;P&gt;But, the code that I needed to execute on this event does not seem to be working 100%.&lt;/P&gt;&lt;P&gt;When the map is switched this code fires.&amp;nbsp; The map zooms to the previous saved extent(mv1Ext).&amp;nbsp; Then the JimuMaptool (jsapi Home widget) is found.&amp;nbsp; But the Home widget will not take the new home extent of mv1Ext (which was just used above).&amp;nbsp; &amp;nbsp;The Home extent defaults to all features in layer.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const activeViewChangeHandler = (jmv: JimuMapView) =&amp;gt; {
    if (jmv) {
      alert(jmv.dataSourceId)
      if (mapView.isActive) {
        alert('mapView.isActive') 
        if (mv1Ext) {
          jmv.view.goTo(mv1Ext)
          let myViewpoint = new Viewpoint ({targetGeometry: mv1Ext})
          const MapTools:JimuMapTool[] = jmv.jimuMapTools
          MapTools.forEach( (element) =&amp;gt; {
            if (element.name === "Home") {
              alert('found Home Widget')
              element.instance.viewpoint = new Viewpoint({targetGeometry: mv1Ext})
            }
          })
        }       
      }
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;The above code is used in the jimu component render event&lt;/P&gt;&lt;P&gt;See successfully executing code below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    else if (myTitle.includes("Hot")) {
      if (!mapView.isActive) {return}
      mySQL = HZquery.where
      if (myTitle.includes("Hot")) {     
        DL_layer.definitionExpression = mySQL
          DL_layer.when(() =&amp;gt; {
            return DL_layer.queryExtent()
          })
          .then((response) =&amp;gt; {
            myExt = response.extent
            myExt.expand(1.25)
            mv1Ext = myExt
            mapView.view.goTo(myExt)
            const MapTools:JimuMapTool[] = mapView.jimuMapTools
            MapTools.forEach( (element) =&amp;gt; {
              if (element.name === "Home") {
                element.instance.viewpoint = new Viewpoint({targetGeometry: mv1Ext})
              }
            })
          })
        }   
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note the same code getting the jsapi Home widget.&amp;nbsp; This code executes fine and sets the Home extent to the previously set mv1Ext.&lt;/P&gt;&lt;P&gt;Any ideas what is going on?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 20:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1411192#M12140</guid>
      <dc:creator>brundageb</dc:creator>
      <dc:date>2024-04-17T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: ExpB Map Widget (JimuMapViews container), JimuMapTools 'Select' Widget (how to monitor for changes?)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1576731#M16966</link>
      <description>&lt;P&gt;Hey did you ever figure this out?&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am having the exact same issue, adding a new home widget or replacing the original does not seem to be doing anything.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 08:36:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expb-map-widget-jimumapviews-container/m-p/1576731#M16966</guid>
      <dc:creator>IkelosDev</dc:creator>
      <dc:date>2025-01-17T08:36:26Z</dc:date>
    </item>
  </channel>
</rss>

