<?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: change selected feature symbol in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1215572#M78801</link>
    <description>&lt;P&gt;And check out this latest post from&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756" target="_self"&gt;&lt;SPAN class=""&gt;UndralBatsukh&lt;/SPAN&gt;&lt;/A&gt;. Seems you can change the color properties on the Highlight option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="Highlighting" href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/hittest-different-highlight-based-on-feature-value/m-p/1215504" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/hittest-different-highlight-based-on-feature-value/m-p/1215504&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 16:12:08 GMT</pubDate>
    <dc:creator>JeffreyWilkerson</dc:creator>
    <dc:date>2022-09-23T16:12:08Z</dc:date>
    <item>
      <title>change selected feature symbol</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1214974#M78775</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I want to change the fill of the symbol of a feature after double-click to show it is selected.&lt;/P&gt;&lt;P&gt;my code now :&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;    myView.on('double-click', (event) =&amp;gt; {
      myView.hitTest(event).then((graphics) =&amp;gt; {
      })
    })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and after that I get the graphics that have been double-clicked, but where is the symbol property of the selected feature graphic?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 08:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1214974#M78775</guid>
      <dc:creator>Guy_srb</dc:creator>
      <dc:date>2022-09-22T08:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: change selected feature symbol</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1215150#M78781</link>
      <description>&lt;P&gt;There is a way to &lt;A title="highlight" href="https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/" target="_blank" rel="noopener"&gt;'highlight'&lt;/A&gt; a selected feature (), but I'm not sure about setting its properties. There is a default graphics layer which is handling all of the graphics you see when you specify a feature layer, and you can interact with this but I think it's recommended to add a new &lt;A title="graphicsLayer" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html" target="_blank" rel="noopener"&gt;graphicsLayer&lt;/A&gt;&amp;nbsp;and interact with that. Maybe&amp;nbsp; you can get the graphic, change its properties, and add it back to the default graphics layer, but I'm not sure about that.&lt;/P&gt;&lt;P&gt;I have an application that adds a graphic at the selected feature location by creating a new graphic and adding it to an added graphics layer. The previous graphic is removed whenever a new one is created so there needs to be a tool to get rid of the last one unless it can be left in the graphics layer. I handle this with a button but I imagine it could be a time delayed thing.&lt;/P&gt;&lt;P&gt;Some code on this last point:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Selection point symbol
const markerSymbol = {
    type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
    color: { r: 51, g: 51, b: 204, a: 0.6 },
    outline: {
        // autocasts as new SimpleLineSymbol()
        color: [51, 51, 204],
        width: 2
    }
}

// Set up function to collect location if clicked and nothing exists so that a new point can be added.
 view.on("immediate-click", (event) =&amp;gt; {

    // require(["esri/layers/GraphicsLayer"
    
    // Layer used to draw graphics returned
    const gLayer = new GraphicsLayer({
      id: "tempGraphics"
    });
    map.add(gLayer);
    
    view.on("immediate-click", (event) =&amp;gt; {
      // Listen for when the user clicks on the view
      view.hitTest(event).then((response) =&amp;gt; {
          let curPt = view.toMap(response.screenPoint);

          let graphics = response.results.filter(function (result) {
              // check if the graphic belongs to the layer of interest
              return result.graphic.layer === busStopLayer;
          });

          if (graphics.length &amp;gt; 0) {
            if (gLayer) {
              gLayer.removeAll();
            }
            
            //Add a graphic at the point selected
            let ptGraphic = new Graphic({
              geometry: curPt,
              symbol: markerSymbol
            })
            gLayer.graphics.add(ptGraphic);
          }
      });
    });
});  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 16:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1215150#M78781</guid>
      <dc:creator>JeffreyWilkerson</dc:creator>
      <dc:date>2022-09-22T16:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: change selected feature symbol</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1215572#M78801</link>
      <description>&lt;P&gt;And check out this latest post from&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756" target="_self"&gt;&lt;SPAN class=""&gt;UndralBatsukh&lt;/SPAN&gt;&lt;/A&gt;. Seems you can change the color properties on the Highlight option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="Highlighting" href="https://community.esri.com/t5/arcgis-api-for-javascript-questions/hittest-different-highlight-based-on-feature-value/m-p/1215504" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://community.esri.com/t5/arcgis-api-for-javascript-questions/hittest-different-highlight-based-on-feature-value/m-p/1215504&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-selected-feature-symbol/m-p/1215572#M78801</guid>
      <dc:creator>JeffreyWilkerson</dc:creator>
      <dc:date>2022-09-23T16:12:08Z</dc:date>
    </item>
  </channel>
</rss>

