Initializes a new ServiceLayer object and connects the layer to the OpenStreetMap mapping service.

Namespace:  ESRI.ArcGISExplorer.Mapping

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public static ServiceLayer OpenOpenStreetMap()
Visual Basic (Declaration)
Public Shared Function OpenOpenStreetMap As ServiceLayer

Return Value

A ServiceLayer object connected to the OpenStreetMap mapping service.

Remarks

For more information, go to the OpenStreetMap website.

Examples

The code below demonstrates how to both create a ServiceLayer and connect it to the OpenStreetMap mapping service in a single call using the static OpenOpenStreetMap method.
CopyC#
{
  try
  {
    //Create and connect to the OpenStreetMap mapping service 
    ServiceLayer openStreetMapLayer = ServiceLayer.OpenOpenStreetMap();

    //Add layer to the map
    ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(openStreetMapLayer);
  }

  catch (ESRI.ArcGISExplorer.ConnectionException ex)
  {
    System.Diagnostics.Debug.Print(ex.Message);
  }
}
CopyVB.NET
Try
  'Create and connect to the OpenStreetMap mapping service 
  Dim openStreetMapLayer As ServiceLayer = ServiceLayer.OpenOpenStreetMap()

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

Exceptions

ExceptionCondition
ESRI.ArcGISExplorer..::.ConnectionExceptionConnection failed. Check the Message and InnerException properties of the ConnectionException for more information about the reasons for the failure.

See Also