ArcGIS Pro二次开发-打开已存在的地图

 // open an existing map 
            var mapProjectItems = Project.Current.GetItems<MapProjectItem>();
            var mapProjectItem = mapProjectItems.FirstOrDefault(mpi => mpi.Name.Equals("gisoracle地图"));
            Map map = null;
            Task task = QueuedTask.Run(() =>

            {

                map = mapProjectItem.GetMap();

            });
            task.Wait();
            ProApp.Panes.CreateMapPaneAsync(map);