I'm attempting to follow the sample code provided here to allow users to create polygons using FeatureLayer.applyEdits(). The example is explicitly set up to capture point information, and is thus not quite capable "out of the box" of capturing polygon edits/creates.
To date I've tried:
- Changing the layer to a polygon layer hosted on AGOL with anonymous editing enabled (sandbox for proof of concept).
- Changing the geometry type on line 291 to polygon
- - This generates an uncaught reference error that polygon is undefined, though it seems to be handled in MapView.js.
I rather like the look with the box / feature info collector, etc, and could probably repurpose it, if only I could figure out the drawing component.
Any bright ideas on what else I might need to change / modify to be able to change this example to digitise polygons?