I am trying to add multiple geometries of different types - polygon and multipolygon on the map. For this I have used Graphicslayer.
While creating the graphic object I am using "polygon" as the Geomtery type for POLYGON geometry but if we have a MULTIPOLYGON geometry, then what type should i pass in the geometrytype ?
Refering the Geometry , it does not give any option for Multupolygon
Hi @DivyaArora ,
You can consume GeoJSON layer in case of MultiPolygon Geometry as mentioned in their documentation.
GeoJSONLayer | API Reference | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers
There is no explicit mention of MultiPolygon in case of graphic layer.
Geojson layer accepts only single type of geometry.
Could you use the .push() function to add new graphics into one, main GraphicsLayer?
Example here: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#push
// Adds a new graphic to the end of the graphics collection on a GraphicsLayer
graphicsLyr.graphics.push(newGraphic);
// Adds three new graphics to the end of the GraphicsLayer's graphics collection
graphicsLyr.graphics.push(g1, g2, g3);