<?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: moveToFront()/moveToBack() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232734#M21718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Koliter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For future reference, you'll probably get a faster response when posting your questions in the appropriate space. By asking your Javascript question in the &lt;A _jive_internal="true" href="https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript"&gt;Javascript space&lt;/A&gt;‌, it will gain the attention of the Javascript experts much more quickly. And while you added many tags, you didn't include a specific Javascript tag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Feb 2015 16:18:42 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2015-02-18T16:18:42Z</dc:date>
    <item>
      <title>moveToFront()/moveToBack()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232731#M21715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am currently in need of functions who can do the same thing as "graphic".getDojoShape().moveToFront() and "graphic".getDojoShape().moveToBack() functions. But I need to keep track of the Z-index of the graphics that are being reordered. Any ideas of how I could achieve that? Only in Javascript or jquery, no java. Is there a way I can access to the code of those two functions? Or know what do they change/reorder and where is it in the object map.graphics. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to keep track because I need to revert it back sometimes. So I need to revert it to the correct position.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i know where I can make myself a function. I just can figure out what is changing. Because it doesn't reorder the graphics object.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time!&lt;BR /&gt;Koliter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 15:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232731#M21715</guid>
      <dc:creator>koliterergonthe</dc:creator>
      <dc:date>2015-01-30T15:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: moveToFront()/moveToBack()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232732#M21716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really need an answer for this question. It is totally essential to my project. Otherwise I can't save the modifications which has been done. I've been patient enough I think..&amp;nbsp; Like i said, I ABSOLUTELY need to know what it changes and where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time!&lt;BR /&gt;Koliter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 22:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232732#M21716</guid>
      <dc:creator>koliterergonthe</dc:creator>
      <dc:date>2015-02-03T22:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: moveToFront()/moveToBack()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232733#M21717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings Koliter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could build a function similar to the one below.&amp;nbsp; In this case I am reordering the drawing order of the graphics that have a textsymbol, so they will always draw on top of the other graphics.&amp;nbsp; You could set/manage an drawing hierarchy that would suite you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function reorderGraphics() {
&amp;nbsp; // text for measurements needs to be on type all others
&amp;nbsp; var graArray = [];
&amp;nbsp; // make 2 pass through the graphics in the measure array move text to the top.
&amp;nbsp; // second pass adds text graphics
&amp;nbsp; for (var i = 0; i &amp;lt; drawLayer.graphics.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var gra = drawLayer.graphics&lt;I&gt;;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (gra.symbol.type == 'textsymbol') {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graArray.push(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; // first pass adds non text graphics
&amp;nbsp; for (var i = 0; i &amp;lt; drawLayer.graphics.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var gra = drawLayer.graphics&lt;I&gt;;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (gra.symbol.type != 'textsymbol') {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graArray.push(gra);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; drawLayer.graphics = graArray;
&amp;nbsp; drawLayer.redraw();
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232733#M21717</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2021-12-11T11:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: moveToFront()/moveToBack()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232734#M21718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Koliter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For future reference, you'll probably get a faster response when posting your questions in the appropriate space. By asking your Javascript question in the &lt;A _jive_internal="true" href="https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript"&gt;Javascript space&lt;/A&gt;‌, it will gain the attention of the Javascript experts much more quickly. And while you added many tags, you didn't include a specific Javascript tag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 16:18:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232734#M21718</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2015-02-18T16:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: moveToFront()/moveToBack()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232735#M21719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've had issues with the moveToFront / moveToBack methods - when all the graphics in the graphics layer are visible in the view extent it works fine, but when one or more of the graphics in the graphics layer are out of the view extent, calling these methods on a specific graphic returned a TypeError (definitely&amp;nbsp;buggy). &amp;nbsp;With your array-build-redraw method it is solved.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 13:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/movetofront-movetoback/m-p/232735#M21719</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-01-31T13:46:30Z</dc:date>
    </item>
  </channel>
</rss>

