Initializes a new ServiceLayer object and connects the layer to a ArcGIS Server 3D globe service.

Namespace:  ESRI.ArcGISExplorer.Mapping
Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.900 (2.0.0.900)

Syntax

C#
public static ServiceLayer OpenGlobeServer(
	Uri url,
	string service,
	string subService
)
Visual Basic (Declaration)
Public Shared Function OpenGlobeServer ( _
	url As Uri, _
	service As String, _
	subService As String _
) As ServiceLayer

Parameters

url
Type: System..::.Uri
A Uri object which represents a Uniform Resource Identifier and consists of a string used to identify the globe service on the Internet.
service
Type: System..::.String
The name of the service.
subService
Type: System..::.String
The name of the sub service.

Return Value

A ServiceLayer object connected to the specified ArcGIS Server 3D globe service.

Remarks

Use this method to both instantiate a ServiceLayer and connect the layer to a ArcGIS Server 3D globe service. In contrast to the Connect method, an exception will be thrown if the specified service cannot be accessed.

Examples

The code below demonstrates how to both create and connect a ServiceLayer in a single call using the static OpenGlobeServer method.
CopyC#
{
  try
  {
    //Create and connect to the Physical subservice in the NPS_PhysicalWorld globe service
    ServiceLayer sl = ServiceLayer.OpenGlobeServer(new Uri("http://services.arcgisonline.com/arcgis/services"),
                                                           "NPS_Physical_World",
                                                           "Physical");

    //Add layer to the map
    ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(sl);
  }
  catch (Exception ex)
  {
    System.Diagnostics.Debug.Print(ex.Message);
  }
}
CopyVB.NET
Try
  'Create and connect to the Physical subservice in the NPS_PhysicalWorld globe service
  Dim sl As ServiceLayer = ServiceLayer.OpenGlobeServer(New Uri("http://services.arcgisonline.com/arcgis/services"), _
                                                         "NPS_Physical_World", "Physical")

  'Add layer to the map
  ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(sl)
Catch ex As Exception
  System.Diagnostics.Debug.Print(ex.Message)
End Try

See Also

Relate Topics:
  OpenGlobeServer Method (Uri, String, String, String, String)
Created by Atop CHM to web converter,© 2009 all right reserved.