<?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 Re: The ActiveViewChange function is not working in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347391#M9280</link>
    <description>&lt;P&gt;I typically get the mapView with these two lines. They do not need to be within the onActiveViewChange function.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const viewManager = MapViewManager.getInstance()
    const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 08 Nov 2023 20:35:20 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2023-11-08T20:35:20Z</dc:date>
    <item>
      <title>The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347263#M9273</link>
      <description>&lt;P&gt;I tried to modify the widget for displaying map coordinates alongside it. However, when I launched it, I noticed that the ActiveViewChange function does not execute. Below is my widget's code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export default class Widget extends React.Component&amp;lt;AllWidgetProps&amp;lt;IMConfig&amp;gt;, any&amp;gt;{
  constructor(props) {
    super(props);
  }
  ActiveViewChange = (jmv: JimuMapView): void =&amp;gt; {
    console.log(jmv)
  }
  render() {
    return (
      &amp;lt;div className="widget-demo jimu-widget m-2"&amp;gt;
        {this.props.hasOwnProperty("useMapWidgetIds") &amp;amp;&amp;amp;
          this.props.useMapWidgetIds &amp;amp;&amp;amp;
          this.props.useMapWidgetIds.length === 1 &amp;amp;&amp;amp; (
            &amp;lt;JimuMapViewComponent
              useMapWidgetId={this.props.useMapWidgetIds?.[0]}
              onActiveViewChange={this.ActiveViewChange}
            /&amp;gt;
          )}
        &amp;lt;p&amp;gt;&amp;lt;FormattedMessage id="pr" defaultMessage={defaultMessages.pr} /&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    )
  }
}&lt;/LI-CODE&gt;&lt;P&gt;Is there anyone who might have an idea about the issue?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 17:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347263#M9273</guid>
      <dc:creator>DéveloppeurP</dc:creator>
      <dc:date>2023-11-08T17:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347271#M9274</link>
      <description>&lt;P&gt;The onActiveViewChange function may not operate the way you think it does. It only activates if the entire mapView is changed, as in the the entire map object is replaced with a completely separate map object. It is rarely if ever activated in most Experience Builder applications.&lt;/P&gt;&lt;P&gt;Does this explain your issue?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 17:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347271#M9274</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-11-08T17:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347343#M9277</link>
      <description>&lt;P&gt;I agree with you. However, upon display, it must still execute the function so that I can retrieve my jimuMapView, which should be displayed in the console.log().&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 19:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347343#M9277</guid>
      <dc:creator>DéveloppeurP</dc:creator>
      <dc:date>2023-11-08T19:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347391#M9280</link>
      <description>&lt;P&gt;I typically get the mapView with these two lines. They do not need to be within the onActiveViewChange function.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const viewManager = MapViewManager.getInstance()
    const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 20:35:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347391#M9280</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-11-08T20:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347586#M9292</link>
      <description>&lt;P&gt;This code will allow you to retrieve the MapView from the widget inside the 'Carte' widget in question. My goal is to obtain the MapView of a 'Carte' widget from another widget, and to achieve that, I am required to go through JimuMapViewcomponent.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 08:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347586#M9292</guid>
      <dc:creator>DéveloppeurP</dc:creator>
      <dc:date>2023-11-09T08:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: The ActiveViewChange function is not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347672#M9303</link>
      <description>&lt;P&gt;The code above will get the first JimuMapView in an Experience, but because it is not dependent onActiveViewChange, it will not fail even if this widget loads before JimuMapView is created. You may need to add if checks for mapView to prevent other errors, especially on the first render of this widget.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 13:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/the-activeviewchange-function-is-not-working/m-p/1347672#M9303</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-11-09T13:47:38Z</dc:date>
    </item>
  </channel>
</rss>

