geometryService.on("buffer-complete", function (result) { map.graphics.clear(); //draw the buffer geometry on the map as a map graphic var symbol = new esri.symbol.SimpleFillSymbol( esri.symbol.SimpleFillSymbol.STYLE_NULL, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SHORTDASHDOTDOT, new dojo.Color([0, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.75]) ); var bufferGeometry = result.geometries[0] var graphic = new esri.Graphic(bufferGeometry, symbol); var envelope = graphic.geometry.Extent; map.graphics.add(graphic); //Select features within the buffered polygon. To do so we'll create a query to use the buffer graphic // as the selection geometry. var query = new esri.tasks.Query(); query.geometry = bufferGeometry; query.outFields = ["*"]; var geoms4ConvexHullOp; clulayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (results) { ??? geoms4ConvexHullOp = dojo.map(results, function(eachfeatureresult) { return eachfeatureresult.geometry; } ); //var totalPopulation = sumPopulation(results); //var r = ""; //r = "<b>The total Census Block population within the buffer is <i>" + totalPopulation + "</i>.</b>"; //dojo.byId('messages').innerHTML = r; }); geometryService.convexHull(geoms4ConvexHullOp, function (hullresults) { //var symbol4Hull = new esri.symbol.FillSymbol( //esri.symbol.SimpleFillSymbol.STYLE_BACKWARD_DIAGONAL, //new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([128, 128, 128, 10])), //new dojo.Color([255, 255, 255, 0.75]) //); var symbol4Hull = new esri.symbol.SimpleFillSymbol(); var hullgraphics = new esri.Graphic(hullresults, symbol4Hull); map.graphics.add(hullgraphics); }, function (errors) { alert(errors); }); //http://forums.arcgis.com/threads/88350-Creating-a-minimum-bounding-polygon-around-different-geometry-types });
Solved! Go to Solution.