Map reloads each time switching back to map scene

361
2
12-19-2023 10:59 AM
ChrisRenzi
New Contributor

In our app, we have a few different scenes and each time we switch back to the scene that contains the map, it refreshes which causes it to disappear briefly and then redraw.  We can modify  the ArcGISMapCompnent.OnEnable() method to by pass the InitializeArcGISMap() as follows, and it solves our issue:

if(View.Map ==null)
   InitializeArcGISMap();

But...  since that class is located in the PackageCache, it is not the best place to make custom changes for obvious reasons.  Is there any other way or setting that we can use to instruct the map not to reload?

0 Kudos
2 Replies
ChrisAnderson7
New Contributor
Try adding a dummy script to the root game object and set it to not destroy on load.
0 Kudos
ChrisRenzi
New Contributor

Great idea, but I tried it and the map still reloads.  To give you more info, the scene that holds the map is an additive scene and is never destroyed when switiching scenes.  I was hoping maybe there was a setting on the MapComponent to enable/disable map refresh, but it seems there isn't?

0 Kudos