AnsweredAssumed Answered

How To Create a Polygon JS API 4.9

Question asked by SimonWebster.QFES on Nov 5, 2018
Latest reply on Nov 7, 2018 by SimonWebster.QFES

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?