<?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: toMap no longer works on view in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722646#M67099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rene commented about using one parameter instead of passing the x,y to the toMap function, I changed that and all works now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hadn’t noticed that change in the code you sent me, which was correct, I apologize for overlooking that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Robert and Rene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2019 13:20:18 GMT</pubDate>
    <dc:creator>JeffSauder</dc:creator>
    <dc:date>2019-04-24T13:20:18Z</dc:date>
    <item>
      <title>toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722639#M67092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been having issues with the tools that I created for my javascript application, such as zoom in, measure, etc.&amp;nbsp; I narrowed it down to the code that converts the screen point to x,y map point.&amp;nbsp; This works in the 4.10 version, but not in the 4.11 version.&amp;nbsp; The strange thing is that I have been using the 4.11 version since April 9 and this just broke 2 days ago.&amp;nbsp; Switching back to 4.10 works fine.&lt;/P&gt;&lt;P&gt;So for instance drawing the box polygon, I did a console.log for the variable values at the mouse points.&amp;nbsp; The POINT = is the screen x,y and the second line is the x,y of the 2 envelope points (NW and SE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.11 version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POINT = 954,313&lt;BR /&gt;NaN,0,NaN,0&lt;BR /&gt;POINT = 958,317&lt;BR /&gt;NaN,0,NaN,0&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 4.10 I get these values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POINT = 976,312&lt;BR /&gt;746618.9368489848,850462.2705078744,746727.4440104435,850353.7633464157&lt;BR /&gt;POINT = 989,326&lt;BR /&gt;746618.9368489848,850462.2705078744,748138.0371094076,848834.6630859929&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that converts screen point to map point is pretty straightforward:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(event.action=="update") {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var sPoint = {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;x: event.x,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;y: event.y&lt;BR /&gt; }&lt;BR /&gt; ptUpdate=view.toMap(sPoint.x, sPoint.y);&lt;BR /&gt; console.log("POINT = " + sPoint.x + "," + sPoint.y);&lt;/P&gt;&lt;P&gt;//where view is the mapView and&amp;nbsp;ptUpdate is the point to be calculated to map coordinates and passed to the boxpolygon function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't seen any notices that this toMap function has changed.&amp;nbsp; If there is something I am missing with the 4.11 upgrade and the ability to convert screen coordinates to map coordinates I haven't been able to find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any assistance or guidance provided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2019 19:52:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722639#M67092</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2019-04-23T19:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722640#M67093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you look at the documentation for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;toMap&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;it is expecting one object a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ScreenPoint" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;screenPoint&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;So though your code worked in the past it is incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code should look like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;action&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"update"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sPoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   x&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
   y&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;y
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
ptUpdate&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sPoint&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"POINT = "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ptUpdate&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;x &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ptUpdate&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722640#M67093</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T06:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722641#M67094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.  The code you show is exactly what I have.  Not sure if I’m missing something…&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2019 20:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722641#M67094</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2019-04-23T20:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722642#M67095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Strange. Are you sure sPoint is Not null when you attempt toMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2019 20:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722642#M67095</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-23T20:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722643#M67096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So ya, the signature of view.toMap(x, y) did work (I think undoc'd), along with view.toMap({ x, y }) in 4.10 and below, but we changed that to only accept a single argument as Robert showed, toMap({ x, y });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like this change didn't make it into the release notes for 4.11, sorry about that oversight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2019 22:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722643#M67096</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2019-04-23T22:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722644#M67097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested that and sPoint is not null, it’s passing back the screen coordinates (I tested in both 4.10 and 4.11 and it’s the same).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 13:09:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722644#M67097</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2019-04-24T13:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722645#M67098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; It would help if you can provide a full sample that could be tested that shows this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 13:13:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722645#M67098</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-24T13:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: toMap no longer works on view</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722646#M67099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rene commented about using one parameter instead of passing the x,y to the toMap function, I changed that and all works now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hadn’t noticed that change in the code you sent me, which was correct, I apologize for overlooking that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Robert and Rene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 13:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tomap-no-longer-works-on-view/m-p/722646#M67099</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2019-04-24T13:20:18Z</dc:date>
    </item>
  </channel>
</rss>

