<?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 Custom symbol styles not applying on arcgis-sketch component or widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-symbol-styles-not-applying-on-arcgis-sketch/m-p/1594549#M86670</link>
    <description>&lt;P&gt;Hi I am trying to add a sketch component to my web application. I wanted to simply just be able to specify the symbols it use for the features it creates. I am using the component version of sketch and the documentation says it has attributes:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;pointSymbol,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polylineSymbol,&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polygonSymbol&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;So I set the object into it but the symbol doesn't apply to any of them. I am doing this in my react Component here. And I even tried the non-component version of sketch and it also still doesn't work. Need help on making this work.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import "@arcgis/map-components/dist/components/arcgis-sketch";
import SimpleMarkerSymbol from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
import Sketch from "@arcgis/core/widgets/Sketch.js";
import { useMapViewContext } from "../../MapContainer.context";
import { useEffect } from "react";
import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer";

export default function SketchTool() {
    const {view} = useMapViewContext()
    
    const pointSymbol = new SimpleMarkerSymbol({
        // type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
        style: "circle",
        color: [138, 43, 226],
        size: "16px",
        outline: { // autocasts as new SimpleLineSymbol()
          color: [255, 255, 255],
          width: 3
        }
      })
    
      const polylineSymbol = {
        type: "simple-line", // autocasts as new SimpleLineSymbol()
        color: "#8A2BE2",
        width: "4",
        style: "dash"
      };
    
      const polygonSymbol = {
        type: "simple-fill", // autocasts as new SimpleFillSymbol()
        color: "red",
        style: "solid",
        outline: {
          color: "white",
          width: 1
        }
      };

      useEffect(() =&amp;gt; {
            if(view) {
                      // GraphicsLayer to hold graphics created via sketch view model
                // const graphicsLayer = new GraphicsLayer({
                //     id: "tempGraphics"
                // });
                // view.map.add(graphicsLayer);

                // const sketch = new Sketch({
                //     layer: graphicsLayer,
                //     view: view,
                //     creationMode: "update",
                //     pointSymbol: pointSymbol,
                //     polylineSymbol: polylineSymbol,
                //     polygonSymbol: polygonSymbol
                // });
                // view.ui.add(sketch, "top-right");
            }
      }, [view])
    return (
        &amp;lt;&amp;gt;
            	&amp;lt;arcgis-sketch 
                    position="bottom-right"
                    creation-mode="update"
                    pointSymbol={pointSymbol}
                    polylineSymbol={polylineSymbol}
                    polygonSymbol={polygonSymbol}
                &amp;gt;
                &amp;lt;/arcgis-sketch&amp;gt;
        &amp;lt;/&amp;gt;
    )
}&amp;lt;div&amp;gt; &amp;lt;div&amp;gt; &amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 22:53:10 GMT</pubDate>
    <dc:creator>ShainaR</dc:creator>
    <dc:date>2025-03-11T22:53:10Z</dc:date>
    <item>
      <title>Custom symbol styles not applying on arcgis-sketch component or widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-symbol-styles-not-applying-on-arcgis-sketch/m-p/1594549#M86670</link>
      <description>&lt;P&gt;Hi I am trying to add a sketch component to my web application. I wanted to simply just be able to specify the symbols it use for the features it creates. I am using the component version of sketch and the documentation says it has attributes:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;pointSymbol,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polylineSymbol,&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;polygonSymbol&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;So I set the object into it but the symbol doesn't apply to any of them. I am doing this in my react Component here. And I even tried the non-component version of sketch and it also still doesn't work. Need help on making this work.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import "@arcgis/map-components/dist/components/arcgis-sketch";
import SimpleMarkerSymbol from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
import Sketch from "@arcgis/core/widgets/Sketch.js";
import { useMapViewContext } from "../../MapContainer.context";
import { useEffect } from "react";
import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer";

export default function SketchTool() {
    const {view} = useMapViewContext()
    
    const pointSymbol = new SimpleMarkerSymbol({
        // type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
        style: "circle",
        color: [138, 43, 226],
        size: "16px",
        outline: { // autocasts as new SimpleLineSymbol()
          color: [255, 255, 255],
          width: 3
        }
      })
    
      const polylineSymbol = {
        type: "simple-line", // autocasts as new SimpleLineSymbol()
        color: "#8A2BE2",
        width: "4",
        style: "dash"
      };
    
      const polygonSymbol = {
        type: "simple-fill", // autocasts as new SimpleFillSymbol()
        color: "red",
        style: "solid",
        outline: {
          color: "white",
          width: 1
        }
      };

      useEffect(() =&amp;gt; {
            if(view) {
                      // GraphicsLayer to hold graphics created via sketch view model
                // const graphicsLayer = new GraphicsLayer({
                //     id: "tempGraphics"
                // });
                // view.map.add(graphicsLayer);

                // const sketch = new Sketch({
                //     layer: graphicsLayer,
                //     view: view,
                //     creationMode: "update",
                //     pointSymbol: pointSymbol,
                //     polylineSymbol: polylineSymbol,
                //     polygonSymbol: polygonSymbol
                // });
                // view.ui.add(sketch, "top-right");
            }
      }, [view])
    return (
        &amp;lt;&amp;gt;
            	&amp;lt;arcgis-sketch 
                    position="bottom-right"
                    creation-mode="update"
                    pointSymbol={pointSymbol}
                    polylineSymbol={polylineSymbol}
                    polygonSymbol={polygonSymbol}
                &amp;gt;
                &amp;lt;/arcgis-sketch&amp;gt;
        &amp;lt;/&amp;gt;
    )
}&amp;lt;div&amp;gt; &amp;lt;div&amp;gt; &amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 22:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-symbol-styles-not-applying-on-arcgis-sketch/m-p/1594549#M86670</guid>
      <dc:creator>ShainaR</dc:creator>
      <dc:date>2025-03-11T22:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom symbol styles not applying on arcgis-sketch component or widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-symbol-styles-not-applying-on-arcgis-sketch/m-p/1595534#M86693</link>
      <description>&lt;P&gt;I created a new react app and copied this component. It works fine if you remove that&amp;nbsp;useMapViewContext import.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Edvinas_S_0-1741962850385.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127940iBC65FAAD527D7A5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Edvinas_S_0-1741962850385.png" alt="Edvinas_S_0-1741962850385.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I simplified your component and made it log every time a new graphic was drawn. If this doesn't work, it's possible you have errors in other parts of your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import "@arcgis/map-components/dist/components/arcgis-sketch";
import SimpleMarkerSymbol from "@arcgis/core/symbols/SimpleMarkerSymbol.js";

export default function SketchTool() {
    const pointSymbol = new SimpleMarkerSymbol({
        style: "circle",
        color: [138, 43, 226],
        size: "16px",
        outline: { // autocasts as new SimpleLineSymbol()
          color: [255, 255, 255],
          width: 3
        }
    })
    
    const polylineSymbol = {
        type: "simple-line", // autocasts as new SimpleLineSymbol()
        color: "#8A2BE2",
        width: "4",
        style: "dash"
    };
    
    const polygonSymbol = {
        type: "simple-fill", // autocasts as new SimpleFillSymbol()
        color: "red",
        style: "solid",
        outline: {
          color: "white",
          width: 1
        }
    };
  
    return (
        &amp;lt;&amp;gt;
            &amp;lt;arcgis-sketch 
                position="bottom-right"
                creation-mode="update"
                pointSymbol={pointSymbol}
                polylineSymbol={polylineSymbol}
                polygonSymbol={polygonSymbol}

                onarcgisCreate={(event) =&amp;gt; {
                    if (event.detail.state == "complete") {
                        console.log(event.detail.graphic);
                    }
                    }}
            /&amp;gt;
        &amp;lt;/&amp;gt;
    )
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 14:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-symbol-styles-not-applying-on-arcgis-sketch/m-p/1595534#M86693</guid>
      <dc:creator>Edvinas_S</dc:creator>
      <dc:date>2025-03-14T14:41:23Z</dc:date>
    </item>
  </channel>
</rss>

