<?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: Id task, spatial references and printing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619936#M57907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I have it working and going to answer my own post&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I learned -&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Whatever I did the graphics layer was always 4326, despite what the map is in (27700 in my case)&lt;/LI&gt;&lt;LI&gt;If graphic items are added to a&amp;nbsp; graphics layer then if the projection is NOT the same as the map - it fails to print&lt;/LI&gt;&lt;LI&gt;The results of the ID task have no projection returned with them - or so it would appear&lt;/LI&gt;&lt;LI&gt;but changing the projection of the graphic object prior to adding it to the graphic layer works&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idGeo.push(results&lt;I&gt;.feature.geometry)&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idGeo&lt;I&gt;.spatialReference = inSR&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my bit of code that takes the geometry of the ID features, one at a time, and adds them to an array - without the second line these would get added as 4326.&amp;nbsp; inSR is a pre-defined projection object matching my map (27700)&amp;nbsp; - when I later add the appropriate array item it adds as 27700 and prints.&amp;nbsp; All very odd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:28:09 GMT</pubDate>
    <dc:creator>AdrianMarsden</dc:creator>
    <dc:date>2021-12-12T02:28:09Z</dc:date>
    <item>
      <title>Id task, spatial references and printing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619934#M57905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK - I have an ID task.&amp;nbsp; it pushes results into a HTML table and stores the returned geometries in an array and the HTML table has and extra "highlight" button that, well, highlights the feature into a graphics layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a draw tool bar that allows custom graphics to the same graphics layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I use printemplate way of printing the highlight graphics fail to print.&amp;nbsp; The user added graphics (remember, the same graphics layer) works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have context thingy on my user graphics layer, that allows edit, move etc. If I select the highlight graphic so that the resize handles appear and then print i get the resize handles but still not the graphic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what is different?&amp;nbsp; The only thing I can see is that my user added graphics are in the same projection as the map, 27700.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I specify that the results from the ID task should be in 27700 (they get returned in 4326) by adding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sr = new esri.SpatialReference(27700);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.spatialReference = sr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yet the results still return in 4326!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, two questions - 1) is by diagnostics likely to be correct, that the projectiion is at fault &amp;amp; 2) why don't the identifyParams stick?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ACM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 15:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619934#M57905</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2015-01-19T15:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Id task, spatial references and printing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619935#M57906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK a bit more digging and it appears the user graphics layer is reference 4326!&amp;nbsp; I tried modifyig its creation ths&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userGraphics = new esri.layers.GraphicsLayer({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "usergraphics",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "spatialReference": msr
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it appears that the GraphicsLayer object doesn't support a spatiaReference property!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619935#M57906</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T02:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Id task, spatial references and printing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619936#M57907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I have it working and going to answer my own post&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I learned -&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Whatever I did the graphics layer was always 4326, despite what the map is in (27700 in my case)&lt;/LI&gt;&lt;LI&gt;If graphic items are added to a&amp;nbsp; graphics layer then if the projection is NOT the same as the map - it fails to print&lt;/LI&gt;&lt;LI&gt;The results of the ID task have no projection returned with them - or so it would appear&lt;/LI&gt;&lt;LI&gt;but changing the projection of the graphic object prior to adding it to the graphic layer works&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idGeo.push(results&lt;I&gt;.feature.geometry)&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idGeo&lt;I&gt;.spatialReference = inSR&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my bit of code that takes the geometry of the ID features, one at a time, and adds them to an array - without the second line these would get added as 4326.&amp;nbsp; inSR is a pre-defined projection object matching my map (27700)&amp;nbsp; - when I later add the appropriate array item it adds as 27700 and prints.&amp;nbsp; All very odd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:28:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/id-task-spatial-references-and-printing/m-p/619936#M57907</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T02:28:09Z</dc:date>
    </item>
  </channel>
</rss>

