<?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 Re: Setting up a Silverlight Address Locator in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326399#M8403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried the AddressToLocation sample in the Interactive Samples library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Depending on your Locator, you might have to remove some lines of code in XAML and code behind(for City, Zip, State, LatLon, ...), and you have to replace the geocoding service's url with your url.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are still having troubles, you will have to give us more info about your geocoding service. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good Luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Sep 2010 18:08:54 GMT</pubDate>
    <dc:creator>DarinaTchountcheva</dc:creator>
    <dc:date>2010-09-03T18:08:54Z</dc:date>
    <item>
      <title>Setting up a Silverlight Address Locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326398#M8402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been trying for several days now to get a functioning address locator into my silverlight web map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have followed the ESRI instructions step by step several times using Expression Blend (4), but the instructions don't quite factor in all the linking problems that occur when you are copying code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A link to that guide &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/help/Addresslocator_task.htm"&gt;here&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only functionality I will need is the address to location function, I won't need the location to address function in my map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have my own geocoding services and map services running, and they are functioning just fine in our other hosted maps, I want to eventually redirect these services to silverlight.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However for now I am willing to settle for ANY functioning address finder as long as it builds. That way I can at least retrace the code and tinker around and figure out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help at all would be most appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 15:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326398#M8402</guid>
      <dc:creator>ChrisBryce</dc:creator>
      <dc:date>2010-09-03T15:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a Silverlight Address Locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326399#M8403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried the AddressToLocation sample in the Interactive Samples library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Depending on your Locator, you might have to remove some lines of code in XAML and code behind(for City, Zip, State, LatLon, ...), and you have to replace the geocoding service's url with your url.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are still having troubles, you will have to give us more info about your geocoding service. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good Luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 18:08:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326399#M8403</guid>
      <dc:creator>DarinaTchountcheva</dc:creator>
      <dc:date>2010-09-03T18:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a Silverlight Address Locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326400#M8404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have gotten the map now to draw the icon correctly, however it will not calcuate the proper address down to a high resolution than the City/State/ZIP.&amp;nbsp; The address field entries seems to make no difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void FindAddressButton_Click(object sender, System.Windows.RoutedEventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; Locator locatorTask = new Locator("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/" +
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Locators/ESRI_Geocode_USA/GeocodeServer");

&amp;nbsp;&amp;nbsp; locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; AddressToLocationsParameters addressParameters = new AddressToLocationsParameters();
&amp;nbsp;&amp;nbsp; Dictionary&amp;lt;string, string&amp;gt; address = addressParameters.Address;

&amp;nbsp;&amp;nbsp; address.Add("Address", Address.Text);
&amp;nbsp;&amp;nbsp; address.Add("City", City.Text);
&amp;nbsp;&amp;nbsp; address.Add("State", State.Text);
&amp;nbsp;&amp;nbsp; address.Add("Zip", Zip.Text);

&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; locatorTask.AddressToLocationsAsync(addressParameters);
&amp;nbsp; }

&amp;nbsp; 
&amp;nbsp; private void LocatorTask_AddressToLocationsCompleted(object sender, ESRI.ArcGIS.Client.Tasks.AddressToLocationsEventArgs args)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; if (args.Results.Count &amp;gt; 0)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the best match
&amp;nbsp;&amp;nbsp;&amp;nbsp; AddressCandidate bestCandidate = args.Results[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (AddressCandidate candidate in args.Results)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bestCandidate = (candidate.Score &amp;gt; bestCandidate.Score) ? candidate : bestCandidate;

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic graphic = new Graphic()
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Symbol = AddressToLocationSymbol,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry = bestCandidate.Location
&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes.Add("Address", bestCandidate.Address);
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes.Add("City", bestCandidate.Address);
&amp;nbsp;&amp;nbsp;&amp;nbsp; string latLon = String.Format("{0}, {1}", bestCandidate.Location.X, bestCandidate.Location.Y);
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.Attributes.Add("LatLon", latLon);

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; GraphicsLayer graphicsLayer = Map.Layers["AddressToLocationGraphicsLayer"] as GraphicsLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.ClearGraphics();
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.Graphics.Add(graphic);
&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; MessageBox.Show("No results found");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, it is pretty much the exact code found in the guide above, and it also uses the ESRI geocoder. So i thought maybe the error is in the xaml code.&amp;nbsp; However I cant seem to find anything in there either that looks awry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;StackPanel Margin="27,18,0,8" HorizontalAlignment="Left" &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="Click Find to locate an address" HorizontalAlignment="Center" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Margin="0,0,0,5" Foreground="Black" FontStyle="Italic" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="Address: " Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBox x:Name="Address" Text="510 W 9th" Width="125" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="City: " Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBox x:Name="City" Text="Georgetown" Width="125" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="State: " Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBox x:Name="State" Text="TX" Width="125"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="Zip: " Foreground="Black" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBox x:Name="Zip" Text="" Width="125" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button x:Name="FindAddressButton" Content="Find" Width="176" HorizontalAlignment="Center" Margin="0,5,0,0" Click="FindAddressButton_Click" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Line HorizontalAlignment="Center" X1="0" Y1="10" X2="180" Y2="10" StrokeThickness="1" Stroke="White" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am thinking that perhaps it has something to do with which results to draw, and as a result it is not drawing the correct number of points.&amp;nbsp; OR the address field is messed up some how and is not putting in correct results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I enter the exact same address &lt;/SPAN&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; , it pulls up the correct results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know what could be making this happen?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/setting-up-a-silverlight-address-locator/m-p/326400#M8404</guid>
      <dc:creator>ChrisBryce</dc:creator>
      <dc:date>2021-12-11T15:28:54Z</dc:date>
    </item>
  </channel>
</rss>

