<?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 Sketch change selection color in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072811#M73631</link>
    <description>&lt;P&gt;Is there currently any way to modify the color of the orange selection outline in the ArcGIS 4.x Sketch tool?&lt;/P&gt;&lt;P&gt;See the basic Sketch sample here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/&lt;/A&gt;.&amp;nbsp; Notice when dropping a point on the map, or selecting an existing point, an orange outline surrounds the point you are editing. Inspection into the ES Modules (@arcgis/core/widgets/Sketch/SketchViewModel.js) shows that this orange outline is defined as a symbol on a clone of the user's placed graphic, and that clone is placed into an internal graphics layer defined by the sketch view.&lt;/P&gt;&lt;P&gt;I have tried to find and manipulate this internal layer by iterating through my MapView's .allLayerViews, but this method has shown to be very hacky (and I cannot get the symbology to render correctly on creation of a graphic, only on update).&lt;/P&gt;&lt;P&gt;Thanks in advance for any help that can be offered!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 20:55:21 GMT</pubDate>
    <dc:creator>JacobRothenberger</dc:creator>
    <dc:date>2021-06-25T20:55:21Z</dc:date>
    <item>
      <title>Sketch change selection color</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072811#M73631</link>
      <description>&lt;P&gt;Is there currently any way to modify the color of the orange selection outline in the ArcGIS 4.x Sketch tool?&lt;/P&gt;&lt;P&gt;See the basic Sketch sample here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/&lt;/A&gt;.&amp;nbsp; Notice when dropping a point on the map, or selecting an existing point, an orange outline surrounds the point you are editing. Inspection into the ES Modules (@arcgis/core/widgets/Sketch/SketchViewModel.js) shows that this orange outline is defined as a symbol on a clone of the user's placed graphic, and that clone is placed into an internal graphics layer defined by the sketch view.&lt;/P&gt;&lt;P&gt;I have tried to find and manipulate this internal layer by iterating through my MapView's .allLayerViews, but this method has shown to be very hacky (and I cannot get the symbology to render correctly on creation of a graphic, only on update).&lt;/P&gt;&lt;P&gt;Thanks in advance for any help that can be offered!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 20:55:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072811#M73631</guid>
      <dc:creator>JacobRothenberger</dc:creator>
      <dc:date>2021-06-25T20:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch change selection color</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072820#M73632</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/341350"&gt;@JacobRothenberger&lt;/a&gt;&amp;nbsp; There is no way currently (besides the hacky way) to change the selection color. Here is what I put in the SketchViewModels on update method to change the selection graphics color for a polygon (changing the outline color and the vertex symbol outline color):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;sketchViewModel._internalGraphicsLayer.graphics.map(function(gra){
          if(gra.geometry.type === 'polygon'){
            gra.symbol.outline.color = [0,0,0,0];
          }
          if(gra.geometry.type === 'point'){
            gra.symbol.outline.color = [168,168,168,1];
          }
        })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 21:08:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072820#M73632</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-06-25T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch change selection color</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072892#M73633</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;,&amp;nbsp;thank you so much! This solution is much less hacky than the path I was headed down. Here is my implementation, based on your solution above, using a Sketch widget and ES modules.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Sketch listener for the update event
this.sketchWidget.on("update", (event) =&amp;gt; {
  if(event.state === "start") {
    (this.sketchWidget.viewModel.get("_internalGraphicsLayer") as GraphicsLayer).graphics.map( (graphic) =&amp;gt; {
      if(graphic.geometry.type === "point") {
        (graphic.symbol as SimpleMarkerSymbol).outline.color = new Color([255, 0, 0, 1]);
      }
    });
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also loaded your solution into this sample here:&amp;nbsp;&lt;A href="https://codepen.io/Th3An0maly/pen/oNWvgba" target="_blank"&gt;https://codepen.io/Th3An0maly/pen/oNWvgba&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 03:23:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-change-selection-color/m-p/1072892#M73633</guid>
      <dc:creator>JacobRothenberger</dc:creator>
      <dc:date>2021-06-26T03:23:31Z</dc:date>
    </item>
  </channel>
</rss>

