AnsweredAssumed Answered

MapFactory Instance CreateMap does not add Map to Project

Question asked by sdavis@udcus.com on Sep 25, 2019
Latest reply on Sep 27, 2019 by sdavis@udcus.com

I am trying to add a new map to my Pro project (Pro 2.4.1) via c# and it is not working. My code looks like this:

var map = MapFactory.Instance.CreateMap("New Map", basemap: Basemap.None);

 

It creates the map object fine (I can access it via c# and add layers to it and save it as a map file), but it does not add the map to the project to be used there.

 

In the documentation here

 

ProConcepts Map Authoring · Esri/arcgis-pro-sdk Wiki · GitHub 

 

It says:

 

Methods such as MapFactory.Instance.CreateMap() add the newly created map into the current project. You do not need to write additional code for adding a map to a project.

 

Is there anything else I can try to get this map addes to my project?

Outcomes