Select to view content in your preferred language

ArcGIS API 4.x Create/Edit/Update Multipart Polygons

828
1
Jump to solution
11-24-2021 08:24 AM
RobbCampbell
Emerging Contributor

Is there a way to configure the Editor widget to create/edit multipart polygons? I have a feature service loaded on my map in which I can create/edit my polygon features and attributes. Everything works correctly. I was just wondering if it is possible to extend my application to allow for multipart polygons. Let me know if anyone has any ideas. I understand this is possible using Smart Editor in web app builder, but I am creating more of a stand alone 1 page JavaScript application.  

0 Kudos
1 Solution

Accepted Solutions
RobbCampbell
Emerging Contributor

In case anyone read this and was interested... I figured it out.

Make a sketchViewModel for polygons with a separate graphicsLayer 

On completion of drawing polygon append rings to an array. Keep drawing.

Once you're done drawing, use a button to call a function to create new polygon and add the rings from your array.

Create a graphic from the polygon and add to your features service via applyEdits()

Edit your new polygon with Editor as you would normally.

 

 

View solution in original post

0 Kudos
1 Reply
RobbCampbell
Emerging Contributor

In case anyone read this and was interested... I figured it out.

Make a sketchViewModel for polygons with a separate graphicsLayer 

On completion of drawing polygon append rings to an array. Keep drawing.

Once you're done drawing, use a button to call a function to create new polygon and add the rings from your array.

Create a graphic from the polygon and add to your features service via applyEdits()

Edit your new polygon with Editor as you would normally.

 

 

0 Kudos