Initializes a new instance of the ServiceConnectionProperties class to define the connection
to a Microsoft Bing (formerly Virtual Earth) service.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.900 (2.0.0.900)
Syntax
| C# |
|---|
public ServiceConnectionProperties( BingMapsService bingService ) |
| Visual Basic (Declaration) |
|---|
Public Sub New ( _ bingService As BingMapsService _ ) |
Parameters
- bingService
- Type: ESRI.ArcGISExplorer.Data..::.BingMapsService
One of the BingMapsService values each of which defines a Bing service.
Remarks
The ServiceType will automatically be set to BingMaps.
Examples
The code below demonstrates how to define the connection information to the Bing Maps aerial service using
a ServiceConnectionProperties object. A ServiceLayer object is also created, then connected to the service and
added to the map as a layer.
CopyC#
CopyVB.NET
{
//Define the connection properties to the Aerial Bing Maps service
ServiceConnectionProperties connProps = new ServiceConnectionProperties(BingMapsService.Aerial);
//Create a new ServiceLayer
ServiceLayer serviceLayer = new ServiceLayer(connProps);
//Try to connect the layer to the service
bool connected = serviceLayer.Connect();
//Check to see whether the connection was successful
if (connected)
{
//Add the layer to the map.
ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(serviceLayer);
}
else
{
//Investigate connection issue.
ConnectionStatus status = serviceLayer.ConnectionStatus;
if (status.HasError)
{
System.Diagnostics.Debug.Print(status.ErrorString);
}
}
}'Define the connection properties to the Aerial Bing Maps service Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(BingMapsService.Aerial) 'Create a new ServiceLayer Dim srviceLayer As ServiceLayer = New ServiceLayer(connProps) 'Try to connect the layer to the service Dim connected As Boolean = srviceLayer.Connect() 'Check to see whether the connection was successful If (connected) Then 'Add the layer to the map. ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(srviceLayer) Else 'Investigate connection issue. Dim status As ConnectionStatus = srviceLayer.ConnectionStatus If (status.HasError) Then System.Diagnostics.Debug.Print(status.ErrorString) End If End If

