ArcGIS Explorer Component Help |
ServiceConnectionProperties Constructor (BingMapsService) |
ServiceConnectionProperties Class Example See Also |
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.1500 (2.0.0.1500)
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#
{ //Define the connection properties to the Aerial Bing Maps service ServiceConnectionProperties connProps = new ServiceConnectionProperties(BingMapsService.Aerial); //Create a new ServiceLayer ServiceLayer bingService = new ServiceLayer(connProps); //Try to connect the layer to the service bool connected = bingService.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(bingService); } else { //Investigate connection issue. ConnectionStatus status = bingService.ConnectionStatus; if (status.HasError) { System.Diagnostics.Debug.Print(status.ErrorString); } } }
CopyVB.NET
'Define the connection properties to the Aerial Bing Maps service Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(BingMapsService.Aerial) 'Create a new ServiceLayer Dim bingService As ServiceLayer = New ServiceLayer(connProps) 'Try to connect the layer to the service Dim connected As Boolean = bingService.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(bingService) Else 'Investigate connection issue. Dim status As ConnectionStatus = bingService.ConnectionStatus If (status.HasError) Then System.Diagnostics.Debug.Print(status.ErrorString) End If End If