<?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: Not able to add Sketch widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1552439#M85960</link>
    <description>&lt;P&gt;Can post your source where the viewDiv is created. The problem dont seems like to be with your Sketch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2024 16:51:56 GMT</pubDate>
    <dc:creator>RamaniGanason</dc:creator>
    <dc:date>2024-10-25T16:51:56Z</dc:date>
    <item>
      <title>Not able to add Sketch widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1551394#M85943</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to add Sketch widget to my map as well as add some polygons based on info previously submitted.&lt;/P&gt;&lt;P&gt;When adding the widget an error is shown in the console and widget is not visible. Used a lot of time to figure it out without any luck. Hopefully someone can help me.&lt;/P&gt;&lt;P&gt;Here is the error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-10-23 at 17.58.16.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117888i7B5970D91D556E45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-10-23 at 17.58.16.png" alt="Screenshot 2024-10-23 at 17.58.16.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And here is my complete code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
    "esri/widgets/Sketch",
    "esri/Map",
    "esri/views/MapView",
    "esri/Graphic",
    "esri/layers/GraphicsLayer"
], (Sketch, Map, MapView, Graphic, GraphicsLayer) =&amp;gt; {

    let graphicsLayer = new GraphicsLayer();

    var jsonString = "${sys_json_object}"; // server-side directive to import json
    var jsonObj = JSON.parse(jsonString);


    var map = new Map({
        basemap: "streets-navigation-vector",
        layers: [graphicsLayer]
    });

    var view = new MapView({
        container: "viewDiv",
        map: map,
        zoom: jsonObj.zoom,
        center: [jsonObj.center.longitude, jsonObj.center.latitude]
    });

    view.when(() =&amp;gt; {

        let sketch = new Sketch({
            layer: graphicsLayer,
            view: view
        });

        view.ui.add(sketch, 'top-right');


        var polygon = {
            type: "polygon",
            rings: jsonObj.rings,
            spatialReference: jsonObj.spatialReference
        };

        var fillSymbol = {
            type: "simple-fill",
            color: [227, 139, 79, 0.8], // Orange, semi-transparent
            outline: {
                color: [255, 255, 255],
                width: 1
            }
        };


        var polygonGraphic = new Graphic({
            geometry: polygon,
            symbol: fillSymbol
        });

        graphicsLayer.graphics.add(polygonGraphic);



    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I comment out line 34, the polygon is drawn correctly, but obviously no widget shown.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 16:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1551394#M85943</guid>
      <dc:creator>olega</dc:creator>
      <dc:date>2024-10-23T16:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to add Sketch widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1551799#M85951</link>
      <description>&lt;P&gt;Hello, maybe try adding your polygonGraphic before creating your Sketch&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 13:36:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1551799#M85951</guid>
      <dc:creator>LittleTurtle</dc:creator>
      <dc:date>2024-10-24T13:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to add Sketch widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1552439#M85960</link>
      <description>&lt;P&gt;Can post your source where the viewDiv is created. The problem dont seems like to be with your Sketch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 16:51:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-able-to-add-sketch-widget/m-p/1552439#M85960</guid>
      <dc:creator>RamaniGanason</dc:creator>
      <dc:date>2024-10-25T16:51:56Z</dc:date>
    </item>
  </channel>
</rss>

