This sample demonstrates adding data in a WebMap document housed
via ArcGIS Online (http://www.arcgis.com) in a WPF application. The
WebMap.GetMapAsync Method call takes a Globally Unique Identifier
(GUID) for the WebMap service provided by ArcGIS Online to obtain
the geographic data layers. The WebMap's
GetMapCompletedEventArgs.Map Property is used to add a Map Class to
the WPF application for visual display.
Download Sample Application
< UserControl x:Class = " ArcGISWPFSDK.LoadWebMap "
xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation "
xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml "
xmlns:esri = " http://schemas.esri.com/arcgis/client/2009 " >
< Grid x:Name = " LayoutRoot " >
</ Grid >
</ UserControl >
using System;
using System.Windows.Controls;
using ESRI.ArcGIS.Client.WebMap;
namespace ArcGISWPFSDK
{
public partial class LoadWebMap : UserControl
{
public LoadWebMap()
{
InitializeComponent();
Document webMap = new Document();
webMap.GetMapCompleted += webMap_GetMapCompleted;
webMap.GetMapAsync("00e5e70929e14055ab686df16c842ec1" );
}
void webMap_GetMapCompleted(object sender, GetMapCompletedEventArgs e)
{
if (e.Error == null )
LayoutRoot.Children.Add(e.Map);
}
}
}
Imports System.Windows.Controls
Imports ESRI.ArcGIS.Client.WebMap
Namespace ArcGISWPFSDK
Partial Public Class LoadWebMap
Inherits UserControl
Public Sub New ()
InitializeComponent()
Dim webMap As New Document()
AddHandler webMap.GetMapCompleted, AddressOf webMap_GetMapCompleted
webMap.GetMapAsync("00e5e70929e14055ab686df16c842ec1" )
End Sub
Private Sub webMap_GetMapCompleted(sender As Object , e As GetMapCompletedEventArgs)
If e.[Error ] Is Nothing Then
LayoutRoot.Children.Add(e.Map)
End If
End Sub
End Class
End Namespace
5/16/2014