<?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 Offset for element Layer? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303397#M7829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to set an offset for elements on an element layer like you can for graphics on a graphic layer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jul 2012 18:42:47 GMT</pubDate>
    <dc:creator>JoshPorter</dc:creator>
    <dc:date>2012-07-16T18:42:47Z</dc:date>
    <item>
      <title>Offset for element Layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303397#M7829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to set an offset for elements on an element layer like you can for graphics on a graphic layer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 18:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303397#M7829</guid>
      <dc:creator>JoshPorter</dc:creator>
      <dc:date>2012-07-16T18:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Offset for element Layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303398#M7830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is nothing to do that out of the box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But as the element position is drived by the attached property ElementLayer.Envelope, you could just apply the offset to this envelope.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2012 05:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303398#M7830</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-07-17T05:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Offset for element Layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303399#M7831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you know of a way to translate pixels to esri coords without access to the Maps MapToScreen function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now i am having the element raise an event when it wants its position set and the element layer is executing the following function. This does work and satisfies my needs, but my curiosity is wondering if there is a way to do this from within the UIElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 Private Sub ElementLocationSetRequestListener(pSender As MyUIElement)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'WhereWeWantTheIcon is the geographical point at which we want the center of the icon. (expressed in latitude and longitude)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim WhereWeWantTheIcon As ESRI.ArcGIS.Client.Geometry.MapPoint = mercator.FromGeographic(New ESRI.ArcGIS.Client.Geometry.MapPoint(pSender.Location.X, pSender.Location.Y))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'ShiftedCenter will be the geographical poistion we tell the element it is at so it displays the asset icon at the right place on the map. This will be shifted down and to the right
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ShiftedCenter As New ESRI.ArcGIS.Client.Geometry.MapPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'screencords is our translator between pixels, lat/lon, and esri coords. We get the pixels from the upperleft corner of the actual point where we want the icon
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim screencoords As Point = Map.esriMap.MapToScreen(WhereWeWantTheIcon)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'then we translate the icon using the elements actual width and height, as well as the icons distance from the top left in the MyUIElement object itself. It is a 24px square icon with a 20px distance from top and left, so 20+24/2=32
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShiftedCenter = Map.esriMap.ScreenToMap(New Point(screencoords.X + pSender.ActualWidth / 2 - 32, screencoords.Y + pSender.ActualHeight / 2 - 32))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Client.ElementLayer.SetEnvelope(pSender, New ESRI.ArcGIS.Client.Geometry.Envelope(ShiftedCenter, ShiftedCenter))
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303399#M7831</guid>
      <dc:creator>JoshPorter</dc:creator>
      <dc:date>2021-12-11T14:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Offset for element Layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303400#M7832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Do you know of a way to translate pixels to esri coords without access to the Maps MapToScreen function?&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Map resolution gives the size of one pixel in geographical coordinates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So to translate pixels to map coordinates you can do&amp;nbsp; :&amp;nbsp; map.Resolution * pixels;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 16:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303400#M7832</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-07-19T16:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Offset for element Layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303401#M7833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2012 19:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/offset-for-element-layer/m-p/303401#M7833</guid>
      <dc:creator>JoshPorter</dc:creator>
      <dc:date>2012-07-26T19:47:50Z</dc:date>
    </item>
  </channel>
</rss>

