<?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 capture event click on the LayerList,so zoom layer visible clicked? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-capture-event-click-on-the-layerlist-so-zoom/m-p/327544#M30237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;layerList.on("click",function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.when(function() {&lt;BR /&gt; // Event listener that fires each time an action is triggered&lt;BR /&gt; //layerList.on("click", function(event) {&lt;BR /&gt; // contentLegend=layer;&lt;BR /&gt; //});&lt;BR /&gt; // Create the LayerList widget with the associated actions&lt;BR /&gt; // and add it to the top-right corner of the view.&lt;BR /&gt; // This function will execute once the promise is resolved&lt;/P&gt;&lt;P&gt;contentGroupLayerFeature.when(function() {&lt;BR /&gt; contentGroupLayerFeature.on("trigger-action", function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;contentGroupLayerFeature.on("click", function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; console.log("webmap loaded successfully");&lt;/P&gt;&lt;P&gt;}, function(error){&lt;BR /&gt; // Use the errback function to handle when the view doesn't load properly&lt;BR /&gt; console.log("The view's resources failed to load: ", error);&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2020 17:36:42 GMT</pubDate>
    <dc:creator>Juan_CarlosColchado_Casas</dc:creator>
    <dc:date>2020-06-12T17:36:42Z</dc:date>
    <item>
      <title>How capture event click on the LayerList,so zoom layer visible clicked?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-capture-event-click-on-the-layerlist-so-zoom/m-p/327544#M30237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;layerList.on("click",function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.when(function() {&lt;BR /&gt; // Event listener that fires each time an action is triggered&lt;BR /&gt; //layerList.on("click", function(event) {&lt;BR /&gt; // contentLegend=layer;&lt;BR /&gt; //});&lt;BR /&gt; // Create the LayerList widget with the associated actions&lt;BR /&gt; // and add it to the top-right corner of the view.&lt;BR /&gt; // This function will execute once the promise is resolved&lt;/P&gt;&lt;P&gt;contentGroupLayerFeature.when(function() {&lt;BR /&gt; contentGroupLayerFeature.on("trigger-action", function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;contentGroupLayerFeature.on("click", function(event) {&lt;BR /&gt; var aa="asdas";&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; console.log("webmap loaded successfully");&lt;/P&gt;&lt;P&gt;}, function(error){&lt;BR /&gt; // Use the errback function to handle when the view doesn't load properly&lt;BR /&gt; console.log("The view's resources failed to load: ", error);&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 17:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-capture-event-click-on-the-layerlist-so-zoom/m-p/327544#M30237</guid>
      <dc:creator>Juan_CarlosColchado_Casas</dc:creator>
      <dc:date>2020-06-12T17:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: How capture event click on the LayerList,so zoom layer visible clicked?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-capture-event-click-on-the-layerlist-so-zoom/m-p/327545#M30238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/291653"&gt;Juan Carlos Colchado Casas&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking for identifying the feature where you clicked and then say zoom&lt;/P&gt;&lt;P&gt;to that, what you need to is to use view.hitTest() and check if the feature returned is same as what you are looking for and if yes, then zoomto thay feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like say&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var yourLayer = &amp;lt;layer&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;view.hitTest(event).then(function (response) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;var graphic;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;if (response.results.length) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;graphic = response.results.filter(function (result) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;return result.graphic.layer === yourLayer;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;})[0].graphic;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;//you can then do a view.zoomTo graphic&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 20:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-capture-event-click-on-the-layerlist-so-zoom/m-p/327545#M30238</guid>
      <dc:creator>GeorgeAbraham</dc:creator>
      <dc:date>2020-06-12T20:34:27Z</dc:date>
    </item>
  </channel>
</rss>

