<?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: Impossible to Zoom on a MapPoint in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518948#M13318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so I think I've understood where is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create a point, I send two parameters in latitude and longitude format, but when I want to zoom or to pan, it's not the same format, and this is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I'm trying to search a way to convert this format into the latitude and longitude format, somebody know if it's possible and how realize it ?&lt;/P&gt;&lt;P&gt;(I don't very understand how SpatialReference work...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2016 08:00:05 GMT</pubDate>
    <dc:creator>AlexandreMERMOZ</dc:creator>
    <dc:date>2016-07-08T08:00:05Z</dc:date>
    <item>
      <title>Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518944#M13314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new on ArcGIS ESRI, so sorry for my question :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to zoom on a MapPoint but nothing run. I've try the "CenterAndZoom" method and the ZoomTo(new Envelope(...)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void _mapLoad(object sender, 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;&amp;nbsp; GraphicsLayer gLayer = MyMap.Layers["G_LAYER"] as GraphicsLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (gLayer == null)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gLayer = new GraphicsLayer(){ ID = "gLayer" };
&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; MyMap.Layers.Add(gLayer);


&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; Graphic marker = new Graphic();
&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; marker.Symbol = new SimpleMarkerSymbol();
&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; gLayer.Graphics.Add(marker);
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapPoint location = new MapPoint(46.780764, 4.853947000000062, MyMap.SpatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gLayer.Graphics[0].Geometry = ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(location);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Envelope envFullExtent = gLayer.FullExtent;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMap.ZoomTo(envFullExtent);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMap.PanTo(location);


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //MyMap.ZoomTo(new Envelope(location.X - 100, location.Y - 100, location.X + 100, location.Y + 100));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //_centerAndZoom(MyMap, location, MyMap.Resolution);
&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; //private void _centerAndZoom(Map map, MapPoint mapPoint, double resolution)
&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; double ratio = 1.0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; if (map.Resolution != 0.0)
&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; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ratio = resolution / map.Resolution;
&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; //&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ratio == 1.0)
&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; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.PanTo(mapPoint);
&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; //&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;&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; MapPoint mapCenter = map.Extent.GetCenter();
&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; double X = (mapPoint.X - ratio * mapCenter.X) / (1 - ratio);
&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; double Y = (mapPoint.Y - ratio * mapCenter.Y) / (1 - ratio);
&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; map.ZoomToResolution(resolution, new MapPoint(X, Y));
&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; //}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the "CenterAndZoom" method, I have a "NullReferenceException" on the "map.Extent.GetCenter();" (l. 43) and for the "MyMap.ZoomTo(new Envelope(location.X - 100, location.Y - 100, location.X + 100, location.Y + 100));", I have a blank page with my point in the left up corner. For the "ZoomTo" with "PanTo", nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, can you bring me your help ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:38:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518944#M13314</guid>
      <dc:creator>AlexandreMERMOZ</dc:creator>
      <dc:date>2021-12-11T22:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518945#M13315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have a way to test Silverlight any longer, so I can't test/troubleshoot. But, what happens if you send your &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;MapPoint &lt;STRONG&gt;location&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;to the ZoomTo() method? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, you should seriously contemplate dropping Silverlight ASAP and move to the JSAPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 18:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518945#M13315</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-07-07T18:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518946#M13316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing happens when i send my MapPoint Location to ZoomTo()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have test on another project with button (With the sample), and I realize that when i make that :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void _zoomTo(object sender, RoutedEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapPoint PointTest = new MapPoint(100, 100, MyMap.SpatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMap.PanTo(PointTest);
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is always on the point 0,0, at the equator (With PanTo and ZoomTo).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't very like Silverlight, but I can't do otherwise, it's for my work...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518946#M13316</guid>
      <dc:creator>AlexandreMERMOZ</dc:creator>
      <dc:date>2021-12-11T22:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518947#M13317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure your SpatialReference is valid for the coordinates? Can you sandbox in a minimalistic app and reproduce the error, as a sanity check, or maybe try to reverse engineer the culprit, e.g. by slowly adding functionality back until it re-occurs? I know your hands are tied with Silverlight - you should let them know it has been sunseted and, I believe, may already be unsupported by Esri!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 19:54:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518947#M13317</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-07-07T19:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518948#M13318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so I think I've understood where is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create a point, I send two parameters in latitude and longitude format, but when I want to zoom or to pan, it's not the same format, and this is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I'm trying to search a way to convert this format into the latitude and longitude format, somebody know if it's possible and how realize it ?&lt;/P&gt;&lt;P&gt;(I don't very understand how SpatialReference work...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 08:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518948#M13318</guid>
      <dc:creator>AlexandreMERMOZ</dc:creator>
      <dc:date>2016-07-08T08:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to Zoom on a MapPoint</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518949#M13319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know what the value of SpatialReference is when you debug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 13:24:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/impossible-to-zoom-on-a-mappoint/m-p/518949#M13319</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-07-08T13:24:28Z</dc:date>
    </item>
  </channel>
</rss>

