Reverse Geocode Online

This sample demonstrates reverse-geocoding points using a LocatorTask. To use the sample, simply click on or near a street in the map. When a result is found, it will be drawn on the map with the returned address in the graphic's MapTip.

In the code-behind, a LocatorTask is used to perform an address lookup operation for the clicked point. When a result is returned, a graphic is added to the map, and the address is added to the graphic's attributes such that it shows up in the graphic's MapTip.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocationToAddress"
    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" Background="White" >

        <Grid.Resources>
            <esri:PictureMarkerSymbol x:Key="DefaultMarkerSymbol" OffsetX="12" OffsetY="12" Source="/Assets/Images/x-24x24.png" />
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>

        <esri:Map x:Name="MyMap" Background="#FFE3E3E3" MouseClick="MyMap_MouseClick" WrapAround="True">
            <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
                    Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:GraphicsLayer ID="LocationGraphicsLayer">
                <esri:GraphicsLayer.MapTip>
                    <Grid Background="LightYellow">
                        <StackPanel Orientation="Vertical" Margin="5" >
                            <TextBlock Text="{Binding [Address1]}" HorizontalAlignment="Left" Foreground="Black" />
                            <TextBlock Text="{Binding [Address2]}" HorizontalAlignment="Left" Foreground="Black" />
                            <TextBlock Text="{Binding [LatLon]}" HorizontalAlignment="Left" Foreground="Black" />
                        </StackPanel>
                        <Border BorderBrush="Black" BorderThickness="1" />
                    </Grid>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" Width="350" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <TextBlock x:Name="InformationText" Text="Click on or near a street in the map to define a location. The address of the location will be displayed in a MapTip when the cursor hovers over the marker." 
                HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Left" Margin="30,20,20,30" TextWrapping="Wrap" Foreground="Black"/>
        </Grid>

    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014