<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help with address locator in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-help-with-address-locator/m-p/139877#M3502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whoa there. I found the problem. I had my local map overlaid on top of an ESRI national map. Apparently the zoom didn't know which map was in charge. When I removed the ESRI map it worked fine. Now the question is if there are multiple map layers, how do you tell the locator which map to use for the match and zoom?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Apr 2010 15:38:28 GMT</pubDate>
    <dc:creator>DonFreeman</dc:creator>
    <dc:date>2010-04-05T15:38:28Z</dc:date>
    <item>
      <title>Need help with address locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-help-with-address-locator/m-p/139876#M3501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there, I could use some help getting my address locator to work with my silverlight page. It seems to work OK with a straight /NET page but I'm missing something in the transfer to silverlight. Here's my code. You can tell by the comments some of the things I have tried. (Morton - The REST endpoint is now working.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt; Private Sub FindAddressButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
&amp;nbsp; 
&amp;nbsp; Dim locatorTask As New Locator("http://maps.pagnet.org/arcgis/rest/services/PAGAddressLocator/GeocodeServer")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler locatorTask.AddressToLocationsCompleted, AddressOf LocatorTask_AddressToLocationsCompleted
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler locatorTask.Failed, AddressOf LocatorTask_Failed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim addressParams As New AddressToLocationsParameters()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim addressDictionary As Dictionary(Of String, String) = addressParams.Address

&amp;nbsp; If (Not String.IsNullOrEmpty(Address.Text)) Then
&amp;nbsp;&amp;nbsp; addressDictionary.Add("Street", Address.Text)
&amp;nbsp; End If
&amp;nbsp; 'If (Not String.IsNullOrEmpty(City.Text)) Then
&amp;nbsp; ' addressDictionary.Add("City", City.Text)
&amp;nbsp; 'End If
&amp;nbsp; 'If (Not String.IsNullOrEmpty(State.Text)) Then
&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp; addressDictionary.Add("State", State.Text)
&amp;nbsp; 'End If
&amp;nbsp; 'If (Not String.IsNullOrEmpty(Zip.Text)) Then
&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp; addressDictionary.Add("Zip", Zip.Text)
&amp;nbsp; 'End If

&amp;nbsp; locatorTask.AddressToLocationsAsync(addressParams)
 End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub LocatorTask_AddressToLocationsCompleted(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.AddressToLocationsEventArgs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim returnedCandidates As List(Of AddressCandidate) = args.Results

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.ClearGraphics()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim _candidateList = New List(Of AddressCandidate)()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim candidateListBox As New ListBox()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each candidate As AddressCandidate In returnedCandidates
&amp;nbsp;&amp;nbsp; If candidate.Score &amp;gt;= 95 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; _candidateList.Add(candidate)
&amp;nbsp;&amp;nbsp;&amp;nbsp; candidateListBox.Items.Add(candidate.Address)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim graphic As New Graphic() With {.Symbol = DefaultMarkerSymbol, .Geometry = candidate.Location}

'&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes.Add("street", candidate.Address)
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes.Add("Address", candidate.Address)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Dim latlon As String = String.Format("{0}, {1}", candidate.Location.X, candidate.Location.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'graphic.Attributes.Add("LatLon", latlon)

&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.Graphics.Add(graphic)
&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next candidate

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler candidateListBox.SelectionChanged, AddressOf _candidateListBox_SelectionChanged

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CandidateScrollViewer.Content = candidateListBox
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CandidatePanelGrid.Visibility = Visibility.Visible

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pt As MapPoint = _candidateList(0).Location
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If _firstZoom Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMap.ZoomToResolution(MyMap.Resolution / 4, pt)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _firstZoom = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMap.PanTo(pt)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lastIndex = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candidateListBox.SelectedIndex = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 14:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-help-with-address-locator/m-p/139876#M3501</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2010-04-05T14:13:34Z</dc:date>
    </item>
    <item>
      <title>Need help with address locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-help-with-address-locator/m-p/139877#M3502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whoa there. I found the problem. I had my local map overlaid on top of an ESRI national map. Apparently the zoom didn't know which map was in charge. When I removed the ESRI map it worked fine. Now the question is if there are multiple map layers, how do you tell the locator which map to use for the match and zoom?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:38:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-help-with-address-locator/m-p/139877#M3502</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2010-04-05T15:38:28Z</dc:date>
    </item>
  </channel>
</rss>

