Dissolve javascript api 4.x

809
3
04-20-2020 04:09 PM
jaykapalczynski
Frequent Contributor

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

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
jaykapalczynski
Frequent Contributor

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);

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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);
0 Kudos