function bufferGeom(){ var geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var params = new esri.tasks.BufferParameters(); params.distances = [10]; params.unit = esri.tasks.GeometryService.UNIT_KILOMETER; params.bufferSpatialReference = map.spatialReference; params.outSpatialReference = map.spatialReference; var query = new esri.tasks.Query(); query.where = "OBJECTID < 201"; featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){ console.log('selected'); var infeatures = dojo.map(features,function(feature){ return feature.geometry; }); params.geometries = infeatures; geometryService.buffer(params,showBuffer,function(error){ console.log("error"); }); }); }
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.