<?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: How to add an onClick event on cluster image ? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-an-onclick-event-on-cluster-image/m-p/1488009#M84820</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I found how to access the click event on a cluster, and upon clicking the cluster, I can zoom to the maximum level. However, I encountered an issue where the map center does not align with the points data; instead, it centers on a different area.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I display the center of the points data on the screen when a cluster is clicked?&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Here is the click event code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("click", (event) =&amp;gt; {
      view.hitTest(event).then(({ results }) =&amp;gt; {
        if(results[0].layer?.featureReduction?.type === "cluster" ){
          view.goTo(results[0].graphic.geometry).then(() =&amp;gt; {
            view.zoom = 23;
          })
        }
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 05:00:35 GMT</pubDate>
    <dc:creator>TapanPatra1</dc:creator>
    <dc:date>2024-06-10T05:00:35Z</dc:date>
    <item>
      <title>How to add an onClick event on cluster image ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-an-onclick-event-on-cluster-image/m-p/1476230#M84677</link>
      <description>&lt;P class=""&gt;Hi All,&lt;/P&gt;&lt;P class=""&gt;I am facing difficulties to add an onClick event to the cluster image in ReactJs application,&lt;/P&gt;&lt;P class=""&gt;Below image is the cluster example -&amp;nbsp;If we manually zoom to the maximum level, the cluster is removing&amp;nbsp;and&amp;nbsp;showing three individual data points.&lt;/P&gt;&lt;P class=""&gt;But here I want, when i click only on the cluster image, it should zoom to the maximum level and display only the individual three data,&lt;/P&gt;&lt;P class=""&gt;How to add an event&amp;nbsp;&amp;nbsp;to the cluster image or any other way to do this ?&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-05-21 at 6.02.15 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104758i1877F23337CD0D3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-05-21 at 6.02.15 PM.png" alt="Screenshot 2024-05-21 at 6.02.15 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const clusterConfig = {
      type: "cluster",
      clusterRadius: "100px",
      clusterMinSize: "30px",
      clusterMaxSize: "50px",
      labelingInfo: [{
        deconflictionStrategy: "none",
        labelExpressionInfo: {
          expression: "Text($feature.cluster_count, '#,###')"
        },
        symbol: {
          type: "text",
          color: "#fff",
          font: {
            weight: "bold",
            family: "Noto Sans",
            size: "18px"
          },
        },
        labelPlacement: "center-center",
      }],
      symbol: {
        type: "picture-marker", 
        url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQa88gtYlcIGYRv5X5yEs7NbJ5JkJdDvzCmLf41BtSCgHqCodZV2fa4ZIjCjroPj27SQCE&amp;amp;usqp=CAU",
        width: "50px",
        height: "50px",
      },
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 06:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-an-onclick-event-on-cluster-image/m-p/1476230#M84677</guid>
      <dc:creator>TapanPatra1</dc:creator>
      <dc:date>2024-06-07T06:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an onClick event on cluster image ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-an-onclick-event-on-cluster-image/m-p/1488009#M84820</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I found how to access the click event on a cluster, and upon clicking the cluster, I can zoom to the maximum level. However, I encountered an issue where the map center does not align with the points data; instead, it centers on a different area.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I display the center of the points data on the screen when a cluster is clicked?&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Here is the click event code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("click", (event) =&amp;gt; {
      view.hitTest(event).then(({ results }) =&amp;gt; {
        if(results[0].layer?.featureReduction?.type === "cluster" ){
          view.goTo(results[0].graphic.geometry).then(() =&amp;gt; {
            view.zoom = 23;
          })
        }
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 05:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-an-onclick-event-on-cluster-image/m-p/1488009#M84820</guid>
      <dc:creator>TapanPatra1</dc:creator>
      <dc:date>2024-06-10T05:00:35Z</dc:date>
    </item>
  </channel>
</rss>

