I have a React application using v4.32.10 and in it I have created a control using the arcgisMap control. I am using this control in multiple places once in a stand alone dialog and then twice in a wizard dialog. For the stand alone dialog the argisViewReadyChange event is fired as expected and I can then setup the other required events i.e. to handle events from the sketch control. For the 2 instances being used in the document they are used on consecutive pages within the wizard. When navigating the wizard in a forward direction for the first map the argisViewReadyChange event does not fire, but when moving forward to the second instance of the map control it is fired correctly. If I then used the back navigation in the wizard to return to the first instance of the map control then the event is correctly fired.
As the code is exactly the same in both directions I am at a loss why the event is not being fired in the first instance when moving forward through the wizard. So, what I would like to know is what conditions need to be met for this event to be fired, so I can determine what is going on. I have determined that the updating property of the arcgisMap is being set to true and then false when I am adding in the layers that need to be displayed in the map and they are also being displayed correctly, it is just that the argisViewReadyChange is not being fired so I am unable to handle the sketch events which are being sent with that event to ensure I have a reference to the sketch control.
Solved! Go to Solution.
For reference, the argisViewReadyChange event will fire when one of three things happens.
Without looking at how state/page loads are being handled in a React application, tough to tell when things are being updated and re-rendered. This event is driven by the View.ready property on views. If you want to maintain the state of the map component in a SPA type app, you can enable the autoDestroyDisabled property so that the component will not destroy itself if it is removed and added back to the page.
For reference, the argisViewReadyChange event will fire when one of three things happens.
Without looking at how state/page loads are being handled in a React application, tough to tell when things are being updated and re-rendered. This event is driven by the View.ready property on views. If you want to maintain the state of the map component in a SPA type app, you can enable the autoDestroyDisabled property so that the component will not destroy itself if it is removed and added back to the page.
I could not do anything with the item-id and setting the basemap property of the arcgisMap control did nothing, but creating a new Map object and setting its basemap property and then setting the arcgisMap controls map property with the new map object did work.