AnsweredAssumed Answered

Creating new map panes gets slower and slower

Question asked by kbmeinstein on Sep 1, 2020

I have some code that creates a new map in a new map pane in response to a tool run by the user.  A very simplified version of the code looks something like this:

 

Map myNewMap;

await QueuedTask.Run(async() =>
{
      myNewMap = MapFactory.Instance.CreateMap(mapName);
      myNewMap.SetSpatialReference(someOtherMap.SpatialReference);
});

 

//Some other stuff happens with myNewMap here.....

 

await QueuedTask.Run(async () =>
{

      IMapPane myNewMapPane = await ProApp.Panes.CreateMapPaneAsync(myNewMap, someOtherMapExtent);

});

 

This all seems very straight forward, but I've noticed that after a few new panes have been created, this code runs slower and slower each time another new map/pane is created.  If I go and manually close all of the newly created map panes, the code goes back to running the original speed, but then slows down again as more panes are again added.  Has anyone else experienced this?  Any ideas how to fix this?

Outcomes