<?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: LocationToScreen result is absurd... in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541225#M6623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are creating a point using Longitude and Latitude, so you need to specify the correct "units" using that spatial reference. WGS84 is one spatial reference that uses Longitudes and Latitudes in degrees.&lt;/P&gt;&lt;P&gt;Most likely your map isn't using long/lat values but a projection - probably WebMercator which uses Meters instead. So basically you were providing a location a few meters of (0,0) which just off the coast of Africa, which was several thousand pixels away from your current location, thus giving you some very absurd looking screen coordinates.&lt;/P&gt;&lt;P&gt;It's sort of like paying for a $10 item, but you pay with 10pesos - basically units getting mixed up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second all MapPoint objects are defined as X,Y which roughly translates to Long,Lat, so the order you had was "backwards".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Nov 2018 18:47:16 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2018-11-08T18:47:16Z</dc:date>
    <item>
      <title>LocationToScreen result is absurd...</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541222#M6620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi !&amp;nbsp;&lt;BR /&gt;I'm using the method LocationToScreen (I'm in .NET) to place icons on my map but the result I have with it is absurd... Like a point with -70000, 10000.&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get why because I use ScreenToLocation to get geographic coordinates with success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the method with LocationToScreen inside :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public void GetMapPointCoordinates()&lt;BR /&gt; {&lt;BR /&gt; var targetLatitude = ConvertDMSToDD(DisplayedTargetLatitude);&lt;BR /&gt; var targetLongitude = ConvertDMSToDD(DisplayedTargetLongitude);&lt;BR /&gt; MapPoint mapPoint = new MapPoint(targetLatitude, targetLongitude, ViewRadarMap.MapFranceOffLine.Map.SpatialReference);&lt;BR /&gt; &lt;STRONG&gt;Point pt = ViewRadarMap.MapFranceOffLine.LocationToScreen(mapPoint);&lt;/STRONG&gt;&lt;BR /&gt; double marginBottom = ViewRadarMap.ActualHeight - pt.Y;&lt;BR /&gt; double marginRight = ViewRadarMap.ActualWidth - pt.X;&lt;BR /&gt; _iconPosition.Bottom = marginBottom - 40;&lt;BR /&gt; _iconPosition.Right = marginRight - 40;&lt;BR /&gt; _iconPosition.Top = pt.Y - 40;&lt;BR /&gt; _iconPosition.Left = pt.X - 40;&lt;BR /&gt; ViewRadarMap.TargetPositionIcon.Margin = IconPosition;&lt;BR /&gt; ViewRadarMap.IconNeutral.Margin = IconPosition;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to change the SpatialReferences but the result is still absurd...&lt;BR /&gt;Help me pleeeeaaase ! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 11:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541222#M6620</guid>
      <dc:creator>GarGueg</dc:creator>
      <dc:date>2018-11-07T11:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: LocationToScreen result is absurd...</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541223#M6621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is your map's spatial reference longitude/latitude? (from the result I'm guessing no) Try changing the MapPoint definition to this instead, so that your coordinates you use matches the spatial reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f6f6f6; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;MapPoint mapPoint = new MapPoint(targetLongitude, targetLatitude, SpatialReferences.Wgs84);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f6f6f6; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Also note I swapped the long/lat order&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2018 21:21:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541223#M6621</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-11-07T21:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: LocationToScreen result is absurd...</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541224#M6622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know what kind of black magic this is but... It worked.&amp;nbsp;&lt;BR /&gt;Thank you so much !&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/love.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain me (shortly) why these changes were mandatory in order to get things right ?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 10:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541224#M6622</guid>
      <dc:creator>GarGueg</dc:creator>
      <dc:date>2018-11-08T10:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: LocationToScreen result is absurd...</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541225#M6623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are creating a point using Longitude and Latitude, so you need to specify the correct "units" using that spatial reference. WGS84 is one spatial reference that uses Longitudes and Latitudes in degrees.&lt;/P&gt;&lt;P&gt;Most likely your map isn't using long/lat values but a projection - probably WebMercator which uses Meters instead. So basically you were providing a location a few meters of (0,0) which just off the coast of Africa, which was several thousand pixels away from your current location, thus giving you some very absurd looking screen coordinates.&lt;/P&gt;&lt;P&gt;It's sort of like paying for a $10 item, but you pay with 10pesos - basically units getting mixed up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second all MapPoint objects are defined as X,Y which roughly translates to Long,Lat, so the order you had was "backwards".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 18:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/locationtoscreen-result-is-absurd/m-p/541225#M6623</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-11-08T18:47:16Z</dc:date>
    </item>
  </channel>
</rss>

