i have layer type polygon, how to select polygon containing a point(a point inside polygon, )
You can use something like this
var allPoints = []; var mp = new Multipoint(); arrayUtils.map(YourPointLayer.graphics, function(gra){ mp.addPoint(gra.geometry); allPoints.push(gra); }); mp.spatialReference = YourPointLayer.graphics[0].geometry.spatialReference; var query = new Query(); query.geometry = mp; YourPolygonLayer.selectFeatures(query);
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.