<?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 (4.26) Donut-shaped polygons are drawn with an extra line in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-26-donut-shaped-polygons-are-drawn-with-an-extra/m-p/1524300#M85420</link>
    <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;I am running into an unusual issue with the 4.26 JavaScript maps SDK. I am using the SDK to programmatically draw polygon shapes onto a web map. The vast majority of the polygons are drawn correctly, however there are two edge cases I have encountered where the polygon is not drawn correctly. In both cases, there is an additional line that is drawn that is not visible in ArcPro. This only seems to occur when drawing donut-shaped geometry. This is how the polygon looks in ArcPro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240820_073653.png" style="width: 251px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112896iD2BD51551D1B5E9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240820_073653.png" alt="Screenshot_20240820_073653.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the web map, an additional line is drawn on the geometry.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thumbnail_image004.png" style="width: 387px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112897i2B2CE59734F81CC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="thumbnail_image004.png" alt="thumbnail_image004.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also encountered this issue when drawing more complex polygons. Here is a more complex polygon in ArcPro.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240819_142826.png" style="width: 448px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112899i2F6618614074EB18/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240819_142826.png" alt="Screenshot_20240819_142826.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now in the web map, it is drawn with an extra line as before.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240819_135912.png" style="width: 442px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112900iEA172146B4534CB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240819_135912.png" alt="Screenshot_20240819_135912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the code I am using to draw the polygon shape. The shape data is pulled from a web service as JSON and then is programmatically drawn on the map using the JavaScript maps SDK&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;data['Polygons'].forEach(polygon =&amp;gt; {
    const points = polygon.Polygon.Points.map(part =&amp;gt; part.map(point =&amp;gt; [point.X, point.Y]));
    const clonedPolygonSymbol = JSON.parse(JSON.stringify(polygonCimSymbolData));
    if (geometryData[polygon.Procedure.PROCEDURE_CATEGORY_CODE] != null) {
        clonedPolygonSymbol.symbol.symbolLayers[2].markerGraphics[0].geometry.rings = geometryData[polygon.Procedure.PROCEDURE_CATEGORY_CODE]
    } else {
        clonedPolygonSymbol.symbol.symbolLayers[2].markerGraphics[0].geometry.rings = icons['question']
    }
    clonedPolygonSymbol.symbol.symbolLayers[1].color = [255, 0, 255, 255];
    clonedPolygonSymbol.symbol.symbolLayers[3].color = [255, 0, 255, 128];
    const polygonGraphic = new Graphic({
        geometry: new Polygon({
            hasZ: false,
            hasM: false,
            rings: points,
            spatialReference: spatialReference
        }),
        popupTemplate: new PopupTemplate({
            title: polygon.Procedure.PROCEDURE_ID,
            content: createTableContent(polygon.Procedure)
        }),
        symbol: new CIMSymbol({ data: clonedPolygonSymbol })
    });
    if (!graphics.hasOwnProperty(polygon.Procedure.PROCEDURE_CATEGORY_CODE)) {
        graphics[polygon.Procedure.PROCEDURE_CATEGORY_CODE] = new Collection();
    }
    graphics[polygon.Procedure.PROCEDURE_CATEGORY_CODE].add(polygonGraphic);
})&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 20 Aug 2024 11:57:26 GMT</pubDate>
    <dc:creator>asdfasdf45254</dc:creator>
    <dc:date>2024-08-20T11:57:26Z</dc:date>
    <item>
      <title>(4.26) Donut-shaped polygons are drawn with an extra line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-26-donut-shaped-polygons-are-drawn-with-an-extra/m-p/1524300#M85420</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;I am running into an unusual issue with the 4.26 JavaScript maps SDK. I am using the SDK to programmatically draw polygon shapes onto a web map. The vast majority of the polygons are drawn correctly, however there are two edge cases I have encountered where the polygon is not drawn correctly. In both cases, there is an additional line that is drawn that is not visible in ArcPro. This only seems to occur when drawing donut-shaped geometry. This is how the polygon looks in ArcPro:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240820_073653.png" style="width: 251px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112896iD2BD51551D1B5E9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240820_073653.png" alt="Screenshot_20240820_073653.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the web map, an additional line is drawn on the geometry.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thumbnail_image004.png" style="width: 387px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112897i2B2CE59734F81CC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="thumbnail_image004.png" alt="thumbnail_image004.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also encountered this issue when drawing more complex polygons. Here is a more complex polygon in ArcPro.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240819_142826.png" style="width: 448px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112899i2F6618614074EB18/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240819_142826.png" alt="Screenshot_20240819_142826.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now in the web map, it is drawn with an extra line as before.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_20240819_135912.png" style="width: 442px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112900iEA172146B4534CB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20240819_135912.png" alt="Screenshot_20240819_135912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the code I am using to draw the polygon shape. The shape data is pulled from a web service as JSON and then is programmatically drawn on the map using the JavaScript maps SDK&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;data['Polygons'].forEach(polygon =&amp;gt; {
    const points = polygon.Polygon.Points.map(part =&amp;gt; part.map(point =&amp;gt; [point.X, point.Y]));
    const clonedPolygonSymbol = JSON.parse(JSON.stringify(polygonCimSymbolData));
    if (geometryData[polygon.Procedure.PROCEDURE_CATEGORY_CODE] != null) {
        clonedPolygonSymbol.symbol.symbolLayers[2].markerGraphics[0].geometry.rings = geometryData[polygon.Procedure.PROCEDURE_CATEGORY_CODE]
    } else {
        clonedPolygonSymbol.symbol.symbolLayers[2].markerGraphics[0].geometry.rings = icons['question']
    }
    clonedPolygonSymbol.symbol.symbolLayers[1].color = [255, 0, 255, 255];
    clonedPolygonSymbol.symbol.symbolLayers[3].color = [255, 0, 255, 128];
    const polygonGraphic = new Graphic({
        geometry: new Polygon({
            hasZ: false,
            hasM: false,
            rings: points,
            spatialReference: spatialReference
        }),
        popupTemplate: new PopupTemplate({
            title: polygon.Procedure.PROCEDURE_ID,
            content: createTableContent(polygon.Procedure)
        }),
        symbol: new CIMSymbol({ data: clonedPolygonSymbol })
    });
    if (!graphics.hasOwnProperty(polygon.Procedure.PROCEDURE_CATEGORY_CODE)) {
        graphics[polygon.Procedure.PROCEDURE_CATEGORY_CODE] = new Collection();
    }
    graphics[polygon.Procedure.PROCEDURE_CATEGORY_CODE].add(polygonGraphic);
})&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Aug 2024 11:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-26-donut-shaped-polygons-are-drawn-with-an-extra/m-p/1524300#M85420</guid>
      <dc:creator>asdfasdf45254</dc:creator>
      <dc:date>2024-08-20T11:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: (4.26) Donut-shaped polygons are drawn with an extra line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-26-donut-shaped-polygons-are-drawn-with-an-extra/m-p/1524413#M85426</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/445911"&gt;@asdfasdf45254&lt;/a&gt;&amp;nbsp;- sorry you are running into this issue! I have a few questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do you still see the issue in the latest version of the API, 4.30?&lt;/LI&gt;&lt;LI&gt;If so, can you share the CIMSymbol JSON that you are using along with the polygon geometry?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 14:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-26-donut-shaped-polygons-are-drawn-with-an-extra/m-p/1524413#M85426</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2024-08-20T14:58:20Z</dc:date>
    </item>
  </channel>
</rss>

