Initializes a new instance of the Basemap class from a specified map file (.nmf) and name.
Namespace:
ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.900 (2.0.0.900)
Syntax
C# |
---|
public Basemap( string path, string name ) |
Visual Basic (Declaration) |
---|
Public Sub New ( _ path As String, _ name As String _ ) |
Parameters
- path
- Type: System..::.String
The path to a map file (.nmf) containing one or more Basemap layers.
- name
- Type: System..::.String
The Basemap name. This is displayed in the ArcGIS Explorer contents window if the Basemap is applied to a map.
Remarks
If you would like to use one of the preconfigured ArcGIS Online or Bing basemaps you may find the nested type initializers for Basemap..::.ArcGISOnline and Basemap..::.BingMaps useful.
This constructor sets the Basemap name on initialization. The Basemap name appears in the ArcGIS Explorer contents window if the Basemap is applied to a map. You can change the Basemap name after construction by setting Basemap.Name property.
Examples
The code below demonstrates alternative ways to initialize a Basemap variable, using the overloaded constructors and the nested type initializers
on the Basemap class.
CopyC#
CopyVB.NET

//Create custom basemap using an existing map file Basemap customBasemap = new Basemap(@"C:\Basemaps\RedlandsBasemap.nmf"); //Set the basemap name customBasemap.Name = "Redlands"; //Create custom basemap with a map file and specified name Basemap basemapWithName = new Basemap(@"C:\Basemaps\RedlandsBasemap.nmf", "Redlands"); //Use nested type initializer for Microsoft Bing Aerial photography Basemap virtualEarthAerial = Basemap.BingMaps.Aerial; //Apply any basemap to the current map, in this case Virtual Earth imagery ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.Basemap = virtualEarthAerial;

'Create custom basemap using an existing map file Dim customBasemap As New Basemap("C:\Basemaps\RedlandsBasemap.nmf") 'Set the basemap name customBasemap.Name = "Redlands" 'Create custom basemap with a map file and specified name Dim basemapWithName As New Basemap("C:\Basemaps\RedlandsBasemap.nmf", "Redlands") 'Use nested type initializer for Microsoft Bing Aerial photography Dim virtualEarthAerial As Basemap = Basemap.BingMaps.Aerial 'Apply a basemap to the current map, in this case Bing Aerial photography ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.Basemap = virtualEarthAerial