<?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: issue with change color on mouse move event in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-change-color-on-mouse-move-event/m-p/1315521#M81863</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You cannot change a symbol of a feature participating in a FeatureLayer. That needs to happen through layer's renderer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to change the color of features that intersect your mouse location you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlightOptions" target="_self"&gt;FeatureLayerView.hightlightOptions&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This codepen shows how it can be done:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/JjezNYZ?editors=100" target="_blank"&gt;https://codepen.io/U_B_U/pen/JjezNYZ?editors=100&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 14:25:25 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2023-08-04T14:25:25Z</dc:date>
    <item>
      <title>issue with change color on mouse move event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-change-color-on-mouse-move-event/m-p/1315373#M81861</link>
      <description>&lt;P&gt;I done bellow steps but color doesn't change to the previous after mouse move:&lt;/P&gt;&lt;P&gt;1- created a feature layer with graphic source and set renderer to blue color&lt;/P&gt;&lt;P&gt;2- set green color for specific points on the map after click. I used bellow code for changing to green color:&lt;/P&gt;&lt;P&gt;response.features.map(function (graphic) {&lt;BR /&gt;let stationGraphic = graphic.clone();&lt;BR /&gt;&lt;STRONG&gt;stationGraphic.symbol = pointSymbolGreen&lt;/STRONG&gt;;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;mainView.graphics.add(stationGraphic);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;3- set red color on mouse move event as:&lt;BR /&gt;if (geometry.type === "point") {&lt;BR /&gt;&lt;BR /&gt;if (mainView.graphics.length) {&lt;BR /&gt;for (const mapGraphic of mainView.graphics) {&lt;BR /&gt;if (mapGraphic.geometry.type === "point") {&lt;BR /&gt;&lt;BR /&gt;if (!selectedStaionIds.includes(mapGraphic.attributes.StationID.toString())) { //remove all point colors except green ones&lt;BR /&gt;mainView.graphics.remove(mapGraphic);&lt;BR /&gt;}&lt;BR /&gt;if (selectedStaionIds.includes(layerAttribute.toString())) { //remove current green color&lt;BR /&gt;mainView.graphics.remove(mapGraphic);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;STRONG&gt;graphic.symbol = pointSymbolRed;&lt;/STRONG&gt;&lt;BR /&gt;mainView.graphics.add(graphic);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but specific points remain red after mouse move instead of green like bellow. The code works fine for blue points!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="samitalebi_0-1691108278151.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/77273i1F4DC4B383B79CA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="samitalebi_0-1691108278151.png" alt="samitalebi_0-1691108278151.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 00:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-change-color-on-mouse-move-event/m-p/1315373#M81861</guid>
      <dc:creator>samitalebi</dc:creator>
      <dc:date>2023-08-04T00:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: issue with change color on mouse move event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-change-color-on-mouse-move-event/m-p/1315521#M81863</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You cannot change a symbol of a feature participating in a FeatureLayer. That needs to happen through layer's renderer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to change the color of features that intersect your mouse location you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlightOptions" target="_self"&gt;FeatureLayerView.hightlightOptions&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This codepen shows how it can be done:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/JjezNYZ?editors=100" target="_blank"&gt;https://codepen.io/U_B_U/pen/JjezNYZ?editors=100&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 14:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-change-color-on-mouse-move-event/m-p/1315521#M81863</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-08-04T14:25:25Z</dc:date>
    </item>
  </channel>
</rss>

