Select Features by Drawing a Polygon

2130
4
Jump to solution
07-29-2015 06:51 AM
ShaningYu
Frequent Contributor

I need a component to select features by drawing a polygon.  Do you know where this piece of code can be found?  Thanks.

0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Instead of buffering a point just use the geometry of a drawing.

Select with Feature Layer | ArcGIS API for JavaScript

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Shaning,

  You will use the Draw Toolbar to draw your polygon geometry.

Draw | API Reference | ArcGIS API for JavaScript

Then you will use the geometry to execute a QueryTask or a selectFeatures method on a FeatureLayer.

TimWitt2
MVP Alum

Instead of buffering a point just use the geometry of a drawing.

Select with Feature Layer | ArcGIS API for JavaScript

0 Kudos
ShaningYu
Frequent Contributor

Thanks to both Rob and Tim.  Both answers are correct.  Sorry for the restriction to credit for 2.

0 Kudos
TimWitt2
MVP Alum

You can always mark Roberts answer as helpful.

0 Kudos