/// <summary> /// Opens a web map item in a map pane. /// </summary> /// <param name="item"></param> private async void OpenWebMapAsync(object item) { if (item is WebMapItem) { WebMapItem clickedWebMapItem = (WebMapItem)item; //Open WebMap var currentItem = ItemFactory.Create(clickedWebMapItem.ID, ItemFactory.ItemType.PortalItem); if (MapFactory.CanCreateMapFrom(currentItem)) { var newMap = await MapFactory.CreateMapAsync(currentItem); await FrameworkApplication.Panes.CreateMapPaneAsync(newMap); } } }
/// <summary> /// Opens a web map item in a map pane. /// </summary> /// <param name="item"></param> private async void OpenWebMapAsync(object item) { if (item is WebMapItem) { WebMapItem clickedWebMapItem = (WebMapItem)item; await QueuedTask.Run(() => { //Open WebMap var currentItem = ItemFactory.Instance.Create(clickedWebMapItem.ID, ItemFactory.ItemType.PortalItem); if (MapFactory.Instance.CanCreateMapFrom(currentItem)) { var newMap = MapFactory.Instance.CreateMapFromItem(currentItem); FrameworkApplication.Panes.CreateMapPaneAsync(newMap); } }); } }