How to create Mapview/Map in API

07-06-2017 08:50 PM
New Contributor II

I'm sure this should be easy but i have not been able to find a solution / example :

In my add-in I am bringing in and displaying a new XY point feature layer, with a well known spatial ref.

If the project does not currently have an open map/mapview (eg if a new blank project) then i need to create one - how do i do that via API ?

0 Kudos
1 Reply
by Esri Regular Contributor
Esri Regular Contributor

You can look at these snippets: 

these will create a new 'empty' project.  Additional snippets allow you to create a new project using a template.

Also you can use the following snippet to add a new map (if the project doesn't contain a map) using this snippet:

0 Kudos