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:
In the web map, an additional line is drawn on the geometry.
I have also encountered this issue when drawing more complex polygons. Here is a more complex polygon in ArcPro.
Now in the web map, it is drawn with an extra line as before.
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);
})
Hi @asdfasdf45254 - sorry you are running into this issue! I have a few questions:
Thanks!