Skip to content

Commit

Permalink
Use Map on GetDocumentInfo instead Project (#3484)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankoral authored Jun 6, 2024
1 parent 406e1e2 commit 1d305c7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using Speckle.Connectors.ArcGIS.HostApp;
Expand Down Expand Up @@ -41,7 +40,15 @@ public BasicConnectorBinding(DocumentModelStore store, ArcGISSettings settings,

public string GetConnectorVersion() => Assembly.GetAssembly(GetType()).NotNull().GetVersion();

public DocumentInfo GetDocumentInfo() => new(Project.Current.URI, Project.Current.Name, Project.Current.Name);
public DocumentInfo? GetDocumentInfo()
{
if (MapView.Active is null)
{
return null;
}

return new DocumentInfo(MapView.Active.Map.URI, MapView.Active.Map.Name, MapView.Active.Map.Name);
}

public DocumentModelStore GetDocumentState() => _store;

Expand Down

0 comments on commit 1d305c7

Please sign in to comment.