<?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 How to &amp;amp;amp;quot;raise&amp;amp;amp;quot; selected feature in FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733684#M67975</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using jsapi v2.7 compact version. I have a FeatureLayer layer with lines features from REST service. Lines are quite messy, so there is basically one big haystack. If I select one line (not from map by mouse, but from list of items, with FeatureLayer.selectFeatures()), it will be highlighted, but it is not visible, because others lines a above highlighted line (see picture). If I unselect this line, then it shows above all others. Is it normal behavior? In OpenLayers, select is control and it is above all other layers. How to accomplish that selected feature is always above all others features?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]12946[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;selected feature (red, wider) is not visible, because all other features are above&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 11:00:27 GMT</pubDate>
    <dc:creator>MihkelOviir</dc:creator>
    <dc:date>2012-03-23T11:00:27Z</dc:date>
    <item>
      <title>How to &amp;amp;quot;raise&amp;amp;quot; selected feature in FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733684#M67975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using jsapi v2.7 compact version. I have a FeatureLayer layer with lines features from REST service. Lines are quite messy, so there is basically one big haystack. If I select one line (not from map by mouse, but from list of items, with FeatureLayer.selectFeatures()), it will be highlighted, but it is not visible, because others lines a above highlighted line (see picture). If I unselect this line, then it shows above all others. Is it normal behavior? In OpenLayers, select is control and it is above all other layers. How to accomplish that selected feature is always above all others features?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]12946[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;selected feature (red, wider) is not visible, because all other features are above&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 11:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733684#M67975</guid>
      <dc:creator>MihkelOviir</dc:creator>
      <dc:date>2012-03-23T11:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to "raise" selected feature in FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733685#M67976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Quick question: Are the other lines on top of the selected line in the same FeatureLayer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 12:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733685#M67976</guid>
      <dc:creator>KenDoman</dc:creator>
      <dc:date>2012-03-23T12:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to "raise" selected feature in FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733686#M67977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;get a handle to the esri.Graphic (the feature you have selected) and call&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;g.getDojoShape().moveToFront();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where g is your esri.Graphic&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need to loop through a map's features you can do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.forEach(this.map.getLayer('Points').graphics, function(g) {&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;&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; if(g.attributes.OBJECTID == objectId) &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; { &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(g.getDojoShape() != null) g.getDojoShape().moveToFront(); &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; } });&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 14:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733686#M67977</guid>
      <dc:creator>MattMoyles</dc:creator>
      <dc:date>2012-03-23T14:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to "raise" selected feature in FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733687#M67978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Quick question: Are the other lines on top of the selected line in the same FeatureLayer?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, they are. I already thought, that if I do not get some reasonable solution, I add selected graphic to the map.graphics layer, and remove it on unselection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;get a handle to the esri.Graphic (the feature you have selected) and call&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
g.getDojoShape().moveToFront();
&lt;/PRE&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Almost nice. It did the trick, except if I zoom the map, layer content gets refreshed (ondemand mode), and selected feature seems to be first, that are drawn to the map, so all others are drawn over it. The way how ESRI JSAPI handles selected graphics is stupidity squared (imo).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess that I have two options here, I use other layer above to render selected graphics or use...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
g.getDojoShape().moveToFront();
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;... everywhere if I have selection and layer content might change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But thanks for help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:17:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-amp-amp-quot-raise-amp-amp-quot-selected/m-p/733687#M67978</guid>
      <dc:creator>MihkelOviir</dc:creator>
      <dc:date>2021-12-12T07:17:45Z</dc:date>
    </item>
  </channel>
</rss>

