<?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 Zoom and Pan with Address locator in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604972#M15504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this because the ZoomTo code only executed the first time? Can you zoom in this far?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Apr 2010 17:28:16 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2010-04-09T17:28:16Z</dc:date>
    <item>
      <title>Zoom and Pan with Address locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604971#M15503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an address locator based on the ESRI sample working OK. The code is below. When it first locates the address, it zooms and pans to place the found address within the map frame but it does not center the found address. If I click the Find button again to reexecute the code, it then pans again to center the found address. I would like it to center the first time and not require a second click. I have tried placing the PanTo code in the first half of the IF statement but this seems to have no effect. Can someone tell me what I have to do to get the behavior I want?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; Private Sub LocatorTask_AddressToLocationsCompleted(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.AddressToLocationsEventArgs)
&amp;nbsp; Dim returnedCandidates As List(Of AddressCandidate) = args.Results

&amp;nbsp; Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer)
&amp;nbsp; graphicsLayer.ClearGraphics()

&amp;nbsp; Dim _candidateList = New List(Of AddressCandidate)()
&amp;nbsp; Dim candidateListBox As New ListBox()

&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("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; Next candidate

&amp;nbsp; AddHandler candidateListBox.SelectionChanged, AddressOf _candidateListBox_SelectionChanged

&amp;nbsp; CandidateScrollViewer.Content = candidateListBox
&amp;nbsp; CandidatePanelGrid.Visibility = Visibility.Visible

&amp;nbsp; Dim pt As MapPoint = _candidateList(0).Location
&amp;nbsp; If _firstZoom Then
&amp;nbsp;&amp;nbsp; MyMap.ZoomToResolution(MyMap.Resolution / 8, pt)
&amp;nbsp;&amp;nbsp; _firstZoom = False
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp; MyMap.PanTo(pt)
&amp;nbsp; End If

&amp;nbsp; _lastIndex = 0
&amp;nbsp; candidateListBox.SelectedIndex = 0
 End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 15:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604971#M15503</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2010-04-09T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Zoom and Pan with Address locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604972#M15504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this because the ZoomTo code only executed the first time? Can you zoom in this far?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 17:28:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604972#M15504</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-04-09T17:28:16Z</dc:date>
    </item>
    <item>
      <title>Zoom and Pan with Address locator</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604973#M15505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are only applying ZoomToResolution (the first time in your code), you don't get the expected result because the argument of this method is the center to zoom around (e.g. the fix point). It's not the expected center of the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you place the PanTo code with ZoomToResolution in the first half of the IF statement, you run into an issue with these 2 asynchronous methods that overlap (the pan begins while the zoomtoresolution is not over).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A workaround could be to reexecute PanTo after a delay:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map.ZoomToResolution(MyMap.MaximumResolution / 10, pt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map.PanTo(pt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DispatcherTimer timer = new DispatcherTimer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Interval = TimeSpan.FromMilliseconds(500);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Tick += new EventHandler((s, eventArgs) =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Stop();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map.PanTo(pt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Start();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the result is unaesthetic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another solution would be to use the 'ZoomTo' method, but you will have to expand the point to get the geometry corresponding to the expected resolution (--&amp;gt; not that easy calculation)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are likely others solutions, but I have no more clue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 07:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/zoom-and-pan-with-address-locator/m-p/604973#M15505</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2010-04-12T07:29:00Z</dc:date>
    </item>
  </channel>
</rss>

