<?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: Feature layer onclick and Layer on top of it in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489219#M45479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahhh that is exactly the problem.&amp;nbsp; Since Feature layers and Graphics are both GraphicLayers, your graphics are on top of your feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from the API&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Each map contains a GraphicsLayer by default, accessible using the Map.Graphics property. Beginning with v1.4, you can create your own graphics layers and add them to the map. Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in Map.Graphics is always on top&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that is why your map graphics are always on top.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what you will have to do is create a graphicsLayer, and add your polygons to THAT (instead of map.graphics).&amp;nbsp; This will allow the featureLayer (which IS in map.graphics) to ride on top of your polygons&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Feb 2014 11:10:37 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2014-02-11T11:10:37Z</dc:date>
    <item>
      <title>Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489214#M45474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HI All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using feature-layer on-click in my application instead of map on-click in order to boost performance of the map. Since i am using snapshot mode and all graphics are loaded in the client i don't want to hit server again hence i thought of using feature-layer on-click functionality as when i tried to use map on-click things dint work as expected hence i started using feature layer on-click.My on click method is an below i am trying read some attribute of the graphic object clicked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dojo.connect(featureLayer, "onClick", function(e){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; someMethod(e);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

function someMethod(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = evt.graphic;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var countryName = graphic.attributes.CNTRY_NAME;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WE need day night functionality in our application hence i used &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=6c65b0f17ffc4bfdb71f60ca64d40bcc " rel="nofollow noopener noreferrer" target="_blank"&gt;Day Night &lt;/A&gt;&lt;SPAN&gt;example which draws some polygon's on the map .The problem i am facing when i click on the map since i am using evt.graphic instead of getting featureLayer graphic object which as the attribute i think i am getting the ploygon which is drawn on the map.Hence i get below issue&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; attributes.CNTRY_NAME is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody let me know how can i over come this scenario.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:31:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489214#M45474</guid>
      <dc:creator>vinayb</dc:creator>
      <dc:date>2021-12-11T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489215#M45475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FeatureLayer is a graphicsLayer, and my guess is your graphics are being drawn on top of FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Controlling the order of these is difficult.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does your click work in areas without the overlayed Layer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 13:26:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489215#M45475</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-10T13:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489216#M45476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes it works&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 14:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489216#M45476</guid>
      <dc:creator>vinayb</dc:creator>
      <dc:date>2014-02-10T14:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489217#M45477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might want to output your layerids to verify that things are stacked in the order you think they should be. My guess is your feature layer is not on top and there is another graphicslayer on top of it&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 16:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489217#M45477</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-10T16:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489218#M45478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The layer on top of a feature layer is not actually any other feature layer it is set of polygon drawn so how can i make this not disturb my feature layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489218#M45478</guid>
      <dc:creator>vinayb</dc:creator>
      <dc:date>2014-02-11T07:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489219#M45479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahhh that is exactly the problem.&amp;nbsp; Since Feature layers and Graphics are both GraphicLayers, your graphics are on top of your feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from the API&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Each map contains a GraphicsLayer by default, accessible using the Map.Graphics property. Beginning with v1.4, you can create your own graphics layers and add them to the map. Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in Map.Graphics is always on top&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that is why your map graphics are always on top.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what you will have to do is create a graphicsLayer, and add your polygons to THAT (instead of map.graphics).&amp;nbsp; This will allow the featureLayer (which IS in map.graphics) to ride on top of your polygons&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 11:10:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489219#M45479</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-11T11:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489220#M45480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am not sure if you can draw the polygons on top but not have them interfere with onclick.&amp;nbsp; I just realize that is what you might be trying to do&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that is the case, you might want to switch from onClick to a query type event where you can specify the layer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 11:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489220#M45480</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-11T11:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer onclick and Layer on top of it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489221#M45481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your suggestion , as you told i added all my polygon to one layer and added that layer before my feature layer so that my feature layer is&amp;nbsp; always on top now onClick is working fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; But map looks little ugly it would be great if ploygon sit on feature layer , can you please explain me about query event .When i click on the map (when polygon layer is on top of my feature layer ) how will get the graphic object of feature layer since i am dependent of graphic object attribute (CNTRY_NAME).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 13:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-onclick-and-layer-on-top-of-it/m-p/489221#M45481</guid>
      <dc:creator>vinayb</dc:creator>
      <dc:date>2014-02-11T13:12:36Z</dc:date>
    </item>
  </channel>
</rss>

