Select to view content in your preferred language

(4.26) Donut-shaped polygons are drawn with an extra line

92
1
yesterday
asdfasdf45254
New Contributor

Greetings all,

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:

Screenshot_20240820_073653.png

In the web map, an additional line is drawn on the geometry.

thumbnail_image004.png

I have also encountered this issue when drawing more complex polygons. Here is a more complex polygon in ArcPro.

Screenshot_20240819_142826.png

Now in the web map, it is drawn with an extra line as before.

Screenshot_20240819_135912.png

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

data['Polygons'].forEach(polygon => {
    const points = polygon.Polygon.Points.map(part => part.map(point => [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);
})
0 Kudos
1 Reply
AnneFitz
Esri Regular Contributor

Hi @asdfasdf45254 - sorry you are running into this issue! I have a few questions:

  • Do you still see the issue in the latest version of the API, 4.30?
  • If so, can you share the CIMSymbol JSON that you are using along with the polygon geometry?

Thanks!

0 Kudos