I am currently using the sketch widget to enable users to map out key objects on the map.
However I want to use the power of Feature Layer for the objects created so that i can leverage key capabilities.
Is there a way to sync the Sketch widget (which uses graphics layer) with my Feature layer?
Solved! Go to Solution.
Technically, this is what the Editor widget is for. But if you really wanted to, you could pass the graphics from the Sketch widget into the featureLayer.applyEdits, but kind of seems like the long way to get there. Plus you would need to populate the attributes in some way. You would need a separate FeatureLayer per geometry type as well.
Technically, this is what the Editor widget is for. But if you really wanted to, you could pass the graphics from the Sketch widget into the featureLayer.applyEdits, but kind of seems like the long way to get there. Plus you would need to populate the attributes in some way. You would need a separate FeatureLayer per geometry type as well.
Thanks for the insights, i guess there is a bit of fiddling around. What caught my eye is the last item:
You would need a separate FeatureLayer per geometry type as well.
Would love to understand this more and why?
In this scenario i am using polygon, polyline, and point, are you saying i should have 3 different FeatureLayers for each type? How do you differentiate between those featurelayers (i've been trying to figure out if there is a way to name them and reference them)
FeatureLayers, by design with a FeatureService can only have a single geometry type.
So if you have points, lines, polygons, you need a FeatureLayer for each.