<?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 different icon on individual points ? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-different-icon-on-individual-points/m-p/1373843#M83441</link>
    <description>&lt;P&gt;You can set a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_blank" rel="noopener"&gt;unique value renderer&lt;/A&gt; on the layer and on top of that apply the clustering, like &lt;A href="https://codepen.io/ralucanicola/pen/poYWjQr?editors=100" target="_blank" rel="noopener"&gt;this&lt;/A&gt;. Also make sure to check the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster/" target="_blank" rel="noopener"&gt;awesome clustering samples&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2024 12:54:46 GMT</pubDate>
    <dc:creator>RalucaNicola1</dc:creator>
    <dc:date>2024-01-24T12:54:46Z</dc:date>
    <item>
      <title>How to add different icon on individual points ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-different-icon-on-individual-points/m-p/1373820#M83437</link>
      <description>&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Hi all,&lt;BR /&gt;I am facing difficulties to add different icons for different points in ReactJs application,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Bellow code I have, On load the map cluster are showing, onClick of the cluster individual points are showing. There I want to display different icon based on the pointsData&lt;/P&gt;&lt;P class=""&gt;Type value. For example: all the “Type” : A - should display an icon, “Type:” : B - Should display an another icon and “Type”: C - should display an another icon.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import React, { useRef, useEffect } from "react";
import MapView from "@arcgis/core/views/MapView";
import WebMap from "@arcgis/core/WebMap";
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";




import "./App.css";

function App() {

  const mapRef = useRef(null);

  useEffect(()=&amp;gt;{

    let pointsData = [
      { geometry: { type: "point", y: 13, x: 77.}, type: 'A' },
      {geometry: { type: "point", y: 33, x: -96 }, type: 'A' },
      {geometry: { type: "point", y: -29.97, x: 21.73 }, type: 'B' },
      {geometry: { type: "point", y: -25.97, x: 28.73 }, type: 'B' },
      {geometry: { type: "point", y: -24.97, x: 24.73 }, type: 'C' },
      {geometry: { type: "point", y: -23.97, x: 23.73 }, type: 'C' },
      {geometry: { type: "point", y: -22.97, x: 22.73 }, type: 'A' },
      {geometry: { type: "point", y: -21.97, x: 21.73 }, type: 'A' },
      {geometry: { type: "point", y: -20.97, x: 20.73 }, type: 'B' },
      {geometry: { type: "point", y: -19.97, x: 19.73 }, type: 'B' },
      {geometry: { type: "point", y: -18.97, x: 18.73 }, type: 'B' },
      {geometry: { type: "point", y: -17.97, x: 17.73 }, type: 'A' },
      {geometry: { type: "point", y: -16.97, x: 16.73 }, type: "A" },
      {geometry: { type: "point", y: -15.97, x: 15.73 }, type: "A" },
      {geometry: { type: "point", y: -14.97, x: 14.73 }, type: "C" },
      {geometry: { type: "point", y: -13.97, x: 13.73 }, type: "C" },
      {geometry: { type: "point", y: -12.97, x: 12.73 }, type: "C" },
      {geometry: { type: "point", y: -11.97, x: 11.73 }, type: "C" }
  ]
    
    const layer = new FeatureLayer({
      source: pointsData,
      objectIdField: "ObjectID",
      featureReduction : {
            type: "cluster",
            clusterRadius: "50px",
            clusterMinSize: "40px",
            clusterMaxSize: "60px",
            labelingInfo: [{
              deconflictionStrategy: "none",
              labelExpressionInfo: {
                expression: "Text($feature.cluster_count, '#,###')"
              },
              symbol: {
                type: "text",
                color: "#fff",
                font: {
                  weight: "bold",
                  family: "Noto Sans",
                  size: "14px"
                },
              },
              labelPlacement: "center-center",
            }],
          symbol: {
            type: "picture-marker",
            url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQa88gtYlcIGYRv5X5yEs7NbJ5JkJdDvzCmLf41BtSCgHqCodZV2fa4ZIjCjroPj27SQCE&amp;amp;usqp=CAU",
            width: "20",
            height: "20"
          },
          popupTemplate: {
            title: "Cluster Summary",
            content: "This cluster represents &amp;lt;b&amp;gt;{cluster_count}&amp;lt;/b&amp;gt; features.",
            fieldInfos: [{
              fieldName: "cluster_count",
              format: {
                places: 0,
                digitSeparator: true
              }
            }]
          },
      },
    });

    const myMap = new WebMap({
      basemap: 'topo',
      layers: [layer],
    })

    new MapView({
      map: myMap,
      container: mapRef.current,
    })

  },[])

  return &amp;lt;&amp;gt;
    &amp;lt;h1&amp;gt;ArcGis&amp;lt;/h1&amp;gt;
    &amp;lt;div className="viewDiv" id="mapDiv" ref={mapRef}&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/&amp;gt;
}

export default App;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below image is the result of above code.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-01-24 at 12.08.50 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92611iB4762C783CEA230D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-01-24 at 12.08.50 PM.png" alt="Screenshot 2024-01-24 at 12.08.50 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 10:26:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-different-icon-on-individual-points/m-p/1373820#M83437</guid>
      <dc:creator>TapanPatra</dc:creator>
      <dc:date>2024-01-24T10:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add different icon on individual points ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-different-icon-on-individual-points/m-p/1373843#M83441</link>
      <description>&lt;P&gt;You can set a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_blank" rel="noopener"&gt;unique value renderer&lt;/A&gt; on the layer and on top of that apply the clustering, like &lt;A href="https://codepen.io/ralucanicola/pen/poYWjQr?editors=100" target="_blank" rel="noopener"&gt;this&lt;/A&gt;. Also make sure to check the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster/" target="_blank" rel="noopener"&gt;awesome clustering samples&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 12:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-different-icon-on-individual-points/m-p/1373843#M83441</guid>
      <dc:creator>RalucaNicola1</dc:creator>
      <dc:date>2024-01-24T12:54:46Z</dc:date>
    </item>
  </channel>
</rss>

