Can you do a dissolve on a Graphics Layer in ArcGIS JavaScript API 4.x.
I see reference to this in 3.x but not 4.x
In JavaScript 4.14 I am selecting a specific number of features from a Feature Layer and writing them to a Graphics Layer. I now want to dissolve them to a multi-part polygon so I can update a Feature Class Geometry.
Can I do this with the API or do I need to do this with a Python Published GP Tool
Jay,
The method you are looking for is union on the GeometryService class
https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#union
or the GeometryEngine (if you want to do this clientside)
Does this create one feature, in ArcMap is does not.....
Are there any examples?
I have a Graphics layer with a few graphics in it
I want to union this and write a single feature to another graphics layer.
var union = geometryEngine.union( graphicsLayer1);
graphicsLayer2.addMany(union);
Jay,
In ArcGIS Server Union is similar to dissolve.
An example code follows:
var Geoms = graphicsLayer1.graphics.map(function(gra){
return gra.geometry;
});
var union = geometryEngine.union(Geoms);
graphicsLayer2.add(union);