<?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 Converting a point to screen geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50533#M4436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Ultimately what I'm trying to do is convert a map point to a screen point so that I can offset it by a distance in screen units and then convert it back to map point so I can place it on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do this using the toMapGeometry and toScreenGeometry methods in the &lt;A href="https://developers.arcgis.com/javascript/jsapi/esri.geometry.screenutils-amd.html"&gt;screenUtils &lt;/A&gt;module but they don't work as I expect them to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking the offset out of the equation for a minute, what's confusing is that if I take a map point and convert it to a screen point and then convert it back to a map point again the X and Y are not the same as the original point. Shouldn't they be the same? Am I using these methods incorrectly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code (for whatever reason syntax highlighting is not working for me today...):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var screenGeo = screenUtils.toScreenGeometry(this.map.extent, this.map.width, this.map.height, evt.geometry);&lt;/P&gt;&lt;P&gt;var mapPointGeo = screenUtils.toMapGeometry(this.map.extent, this.map.width, this.map.height, screenGeo);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ouput:&lt;/P&gt;&lt;P&gt;?evt.geometry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: -88.18114353491255&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 41.7207439952267&lt;/P&gt;&lt;P&gt;?screenGeo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: 64564&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 33899&lt;/P&gt;&lt;P&gt;?mapPointGeo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: -83.94943230599165&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 98.94651940930635&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was expecting evt.geometry and mapPointGeo to be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two other methods that are depreciated: toMapPoint and toScreenPoint. These do work as expected (once I do some geographic/web merc conversion). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 21:28:59 GMT</pubDate>
    <dc:creator>JillianStanford</dc:creator>
    <dc:date>2016-04-20T21:28:59Z</dc:date>
    <item>
      <title>Converting a point to screen geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50533#M4436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Ultimately what I'm trying to do is convert a map point to a screen point so that I can offset it by a distance in screen units and then convert it back to map point so I can place it on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do this using the toMapGeometry and toScreenGeometry methods in the &lt;A href="https://developers.arcgis.com/javascript/jsapi/esri.geometry.screenutils-amd.html"&gt;screenUtils &lt;/A&gt;module but they don't work as I expect them to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking the offset out of the equation for a minute, what's confusing is that if I take a map point and convert it to a screen point and then convert it back to a map point again the X and Y are not the same as the original point. Shouldn't they be the same? Am I using these methods incorrectly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code (for whatever reason syntax highlighting is not working for me today...):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var screenGeo = screenUtils.toScreenGeometry(this.map.extent, this.map.width, this.map.height, evt.geometry);&lt;/P&gt;&lt;P&gt;var mapPointGeo = screenUtils.toMapGeometry(this.map.extent, this.map.width, this.map.height, screenGeo);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Ouput:&lt;/P&gt;&lt;P&gt;?evt.geometry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: -88.18114353491255&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 41.7207439952267&lt;/P&gt;&lt;P&gt;?screenGeo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: 64564&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 33899&lt;/P&gt;&lt;P&gt;?mapPointGeo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "point"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x: -83.94943230599165&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y: 98.94651940930635&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was expecting evt.geometry and mapPointGeo to be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two other methods that are depreciated: toMapPoint and toScreenPoint. These do work as expected (once I do some geographic/web merc conversion). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 21:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50533#M4436</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2016-04-20T21:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a point to screen geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50534#M4437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jill, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are your input and output geometries in the same spatial reference (webmercator)?&amp;nbsp; If not, have you tried projecting your input point to webmercator before you pass it to the 'toScreenGeometry' function?&amp;nbsp; Does this happen when you are zoomed all the way in to the closest extent?&amp;nbsp; Is the screen location maybe being generalized on the map in the 'toMapGeometry' method (at the world view 1px could = miles of space)?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 22:44:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50534#M4437</guid>
      <dc:creator>BillGrow</dc:creator>
      <dc:date>2016-04-20T22:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a point to screen geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50535#M4438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; have you looked at the toScreen and toMap methods on the map object?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#toscreen" title="https://developers.arcgis.com/javascript/jsapi/map-amd.html#toscreen"&gt;Map | API Reference | ArcGIS API for JavaScript | toScree&lt;/A&gt;n &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 01:48:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50535#M4438</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T01:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a point to screen geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50536#M4439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, what is the ultimate goal here?&amp;nbsp; I feel like GIS &amp;gt; Screen &amp;gt; GIS would be better facilitated by simply adjusting the geometry/symbology, unless there is some UI/UX need for translation to screen px.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;~Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 17:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50536#M4439</guid>
      <dc:creator>BillGrow</dc:creator>
      <dc:date>2016-04-21T17:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a point to screen geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50537#M4440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Thank you so much for all of the replies. I really appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert, you are correct. The Map object's toScreen and toMap methods do give me the expected results. Thanks for the suggestion!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, Bill, your comments made me reevaluate my strategy. You are right that tweaking the symbology gave me what I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 20:17:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/converting-a-point-to-screen-geometry/m-p/50537#M4440</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2016-04-25T20:17:20Z</dc:date>
    </item>
  </channel>
</rss>

