Select to view content in your preferred language

How to get selected feature(s) from Editor widget (4.x)

555
0
03-11-2021 03:13 PM
JeffreyWilkerson
Frequent Contributor

Is there a way to get the selected features when the Editor widget is engaged?

I was looking for a way to attach to a selection event, and then hopefully determine the features from that event, but I can't find that anywhere.  

I tried doing the layerView watch and then using 'queryFeatures' on the layerview, but that shows all of the available features in the layer.  

 

view.whenLayerView(busStopLayer).then(function (busLayerView) {
    busLayerView.watch("updating", function (val) {
        if (!val) {  // wait for the bus stop layer view to finish updating
            busLayerView.queryFeatures().then(function (results) {
                 console.log(results.features);  // grabs client-side graphics
            });
        }
    });
});

 

0 Kudos
0 Replies