Select to view content in your preferred language

ChangeVersion doesn't reflect in TOC on the non active map

144
3
a week ago
PärÅman
Occasional Contributor

Using ArcGIS Pro 3.5x. Consuming ParcelFabric as a feature service.

TOC shows wrong version:

  1. Open project with 2 maps in 2 separate panes, Map1 (the active one) and Map2.
  2. Change version (see code below), new version named yadaversion
  3. List By Data Source in the Contents pane.
  4. Map1: sde.yadaversion  Map2: sde.DEFAULT
  5. Save project and reopen.
  6. Map1: sde.yadaversion  Map2: sde.yadaversion
var maps = Project.Current.GetItems<MapProjectItem>().Select(mpi => mpi.GetMap());
foreach (var map in maps)
{
    map.ChangeVersion(currentVersion, newVersion);
}

TOC shows correct version:

  1. Open project with 2 maps in 2 separate panes, Map1 (the active one) and Map2.
  2. Click on Map2 to make it active (initializing/loading?)
  3. Change version (see code above), new version named yadaversion
  4. List By Data Source in the Contents pane.
  5. Map1: sde.yadaversion  Map2: sde.yadaversion 
  6. SUCCESS!

Conclusion

It seem to me that I have to make sure to "open/activate" Map2 for it to get initialized.

Bug? How would I go about to "initialize" the Map2 pane without setting it to Active (weird map switching occur for user) in the code?

 

Tags (1)
0 Kudos
3 Replies
Aashis
by Esri Contributor
Esri Contributor

@PärÅman, could you please try calling RefreshDatastore in the new version after the Map version change? I think that will address the issue. 

0 Kudos
PärÅman
Occasional Contributor

Tried:

Version newVersion = vmgr.CreateVersion(versionDescription);
foreach (var map in maps)
{
    map.ChangeVersion(currentVersion, newVersion);
}
newVersion.RefreshDatastore();

 Unfortunately it didn't solve the problem.

0 Kudos
Aashis
by Esri Contributor
Esri Contributor

Thank you for trying that. We'll investigate it. 

0 Kudos