<?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 JavaScript 4.x - Projecting State Plane Coordinates to Web Mercator - Having an Issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504551#M46857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone, I added a snippet of code that allows for displaying the coordinates on the map as the cursor moves.&amp;nbsp; Right now, the existing coordinates are on OK State Plane North Coordinates.&amp;nbsp; I want to project these coordinates to a WGS 1984 or a Web Mercator (3857) - (see image below and coordinated within red box):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/441796_Coordinates1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a number of things to reproject these coordinates, but cannot get this to work.&amp;nbsp; I do have a geometry service defined within the application.&amp;nbsp; Things I have tried include:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new ProjectParameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; geomSer = &lt;/SPAN&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; GeometryService( ... ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; params = &lt;/SPAN&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; ProjectParameters({ &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;geometries&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: [point], &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;outSpatialReference&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;&amp;nbsp; &amp;nbsp;outSpatialReference, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;transformation&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: transformation &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Overall, the API documentation isn't that great or are there any good examples to follow to see how this is done.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Here is my current code snippet:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; // Map - Display Coordinates in Lower Left of Map&lt;BR /&gt; function displayMapCoords(evt) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var coordinatePoints = mapView.toMap({x: evt.x, y: evt.y});&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var XCoordinates = coordinatePoints.x.toFixed(6);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var YCoordinates = coordinatePoints.y.toFixed(6);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var combinedXYCoordinates = XCoordinates + ", " + YCoordinates;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Oklahoma State Plane North coordinates are (X, Y): ", combinedXYCoordinates); &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;// Display Map Coordinates in Map&lt;BR /&gt;&amp;nbsp; &amp;nbsp;dom.byId("mapCoordinates").innerHTML = XCoordinates + ", " + YCoordinates;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // Update Coordinates as Mouse Moves&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.when(function(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.on("pointer-move", displayMapCoords);&lt;BR /&gt; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Are there any suggestions on how to return the coordinates back to a WGS 1984 or Web Mercator projection?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2019 15:53:58 GMT</pubDate>
    <dc:creator>IanPeebles</dc:creator>
    <dc:date>2019-04-11T15:53:58Z</dc:date>
    <item>
      <title>JavaScript 4.x - Projecting State Plane Coordinates to Web Mercator - Having an Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504551#M46857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone, I added a snippet of code that allows for displaying the coordinates on the map as the cursor moves.&amp;nbsp; Right now, the existing coordinates are on OK State Plane North Coordinates.&amp;nbsp; I want to project these coordinates to a WGS 1984 or a Web Mercator (3857) - (see image below and coordinated within red box):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/441796_Coordinates1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a number of things to reproject these coordinates, but cannot get this to work.&amp;nbsp; I do have a geometry service defined within the application.&amp;nbsp; Things I have tried include:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new ProjectParameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; geomSer = &lt;/SPAN&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; GeometryService( ... ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; params = &lt;/SPAN&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; ProjectParameters({ &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;geometries&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: [point], &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;outSpatialReference&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;&amp;nbsp; &amp;nbsp;outSpatialReference, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #595959;"&gt;&amp;nbsp; &amp;nbsp;transformation&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;: transformation &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Overall, the API documentation isn't that great or are there any good examples to follow to see how this is done.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Here is my current code snippet:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; // Map - Display Coordinates in Lower Left of Map&lt;BR /&gt; function displayMapCoords(evt) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var coordinatePoints = mapView.toMap({x: evt.x, y: evt.y});&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var XCoordinates = coordinatePoints.x.toFixed(6);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var YCoordinates = coordinatePoints.y.toFixed(6);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var combinedXYCoordinates = XCoordinates + ", " + YCoordinates;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Oklahoma State Plane North coordinates are (X, Y): ", combinedXYCoordinates); &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;// Display Map Coordinates in Map&lt;BR /&gt;&amp;nbsp; &amp;nbsp;dom.byId("mapCoordinates").innerHTML = XCoordinates + ", " + YCoordinates;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // Update Coordinates as Mouse Moves&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.when(function(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mapView.on("pointer-move", displayMapCoords);&lt;BR /&gt; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;Are there any suggestions on how to return the coordinates back to a WGS 1984 or Web Mercator projection?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 15:53:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504551#M46857</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2019-04-11T15:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript 4.x - Projecting State Plane Coordinates to Web Mercator - Having an Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504552#M46858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Why not use the CoordinateConversion widget?&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-coordinateconversion/index.html"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-coordinateconversion/index.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 16:44:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504552#M46858</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-11T16:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript 4.x - Projecting State Plane Coordinates to Web Mercator - Having an Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504553#M46859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robert.&amp;nbsp; I was looking at that widget yesterday and it is really nice, but takes up a little too much real-estate.&amp;nbsp; I really like what I came up with for the app.&amp;nbsp; I do want to get this to work, just so I know it can be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that said, I may end up looking at it again and add it as a tool with the measurement widget...perhaps up here (see red box)?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/441856_Coordinates2.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 18:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504553#M46859</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2019-04-11T18:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript 4.x - Projecting State Plane Coordinates to Web Mercator - Having an Issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504554#M46860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If that is the case then you should look at using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html"&gt;projection class&lt;/A&gt;. It allows for re-projecting geometries clientside without a round trip to the server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 19:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-4-x-projecting-state-plane-coordinates/m-p/504554#M46860</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-11T19:04:43Z</dc:date>
    </item>
  </channel>
</rss>

