<?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 Unable to centre the point feature when zooming to the particular scale in the map. in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/unable-to-centre-the-point-feature-when-zooming-to/m-p/134796#M3370</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 to do the following tasks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 1. pan the point feature to centre of the screen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 2. zoom to the point feature at specific scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to pan the feature to centre of the screen and after that I am able to zoom to the specific scale. But point feature was not centred.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Balu.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2012 11:24:24 GMT</pubDate>
    <dc:creator>BALASARAVANAMUTHUMADASAMY</dc:creator>
    <dc:date>2012-09-21T11:24:24Z</dc:date>
    <item>
      <title>Unable to centre the point feature when zooming to the particular scale in the map.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/unable-to-centre-the-point-feature-when-zooming-to/m-p/134796#M3370</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 to do the following tasks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 1. pan the point feature to centre of the screen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 2. zoom to the point feature at specific scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to pan the feature to centre of the screen and after that I am able to zoom to the specific scale. But point feature was not centred.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Balu.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2012 11:24:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/unable-to-centre-the-point-feature-when-zooming-to/m-p/134796#M3370</guid>
      <dc:creator>BALASARAVANAMUTHUMADASAMY</dc:creator>
      <dc:date>2012-09-21T11:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to centre the point feature when zooming to the particular scale in the ma</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/unable-to-centre-the-point-feature-when-zooming-to/m-p/134797#M3371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I guess there is an issue becasue PanTo and ZoomTo are asynchronous functions (with animations), so executing bothh in // may be an issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example of function panning and zooming with only one call:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void centerAndZoom(ESRI.ArcGIS.Client.Map map, ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint, double resolution)
{
double ratio = 1.0;
if (map.Resolution != 0.0)
ratio = resolution / map.Resolution;

if (ratio == 1.0)
map.PanTo(mapPoint);
else
{
ESRI.ArcGIS.Client.Geometry.MapPoint mapCenter = map.Extent.GetCenter();
double X = (mapPoint.X - ratio * mapCenter.X) / (1 - ratio);
double Y = (mapPoint.Y - ratio * mapCenter.Y) / (1 - ratio);
map.ZoomToResolution(resolution, new ESRI.ArcGIS.Client.Geometry.MapPoint(X, Y));
}
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note : it's using Map.Resolution but might easily be adpated to use Map.Scale.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:32:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/unable-to-centre-the-point-feature-when-zooming-to/m-p/134797#M3371</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T07:32:21Z</dc:date>
    </item>
  </channel>
</rss>

