So I've implemented the Select with Feature Layer sample. The buffering, feature selecting with the buffer all work as expected. Query results are returned, graphic symbology is performed but when I click on a graphic within the buffer, the infoTemplate doesn't appear. Nothing happens. Related code is below.
// selection symbol used to draw the selected census block points within the buffer polygon var isymbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 12, new SimpleLineSymbol( SimpleLineSymbol.STYLE_NULL, new Color([247, 34, 101, 0.9]), 1 ), new Color([207, 34, 171, 0.5]) ); infraFeatureLayer.setSelectionSymbol(isymbol); map.addLayer(infraFeatureLayer);
function fireInfra() { infraHandler = dojo.connect(map,"onClick",findInfrastructure); }
function findInfrastructure(evt) { var paramsI = new BufferParameters(); paramsI.geometries = [ evt.mapPoint ]; paramsI.distances = [ 1 ]; paramsI.unit = GeometryService.UNIT_STATUTE_MILE; gsvc.on("buffer-complete", function(){ dojo.disconnect(infraHandler); }); gsvc.buffer(paramsI, showInfraBuffer); }
function showInfraBuffer(geometries) { map.graphics.clear(); // draw the buffer geometry on the map as a map graphic var symbol = new SimpleFillSymbol( SimpleFillSymbol.STYLE_NULL, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SHORTDASHDOTDOT, new Color([105,105,105]), 2 ),new Color([255,255,0,0.25]) ); //end symbol var bufferGeometry = geometries[0] var graphic = new Graphic(bufferGeometry, symbol); map.graphics.add(graphic); //do query with buffer var query = new Query(); query.geometry = bufferGeometry; query.returnGeometry = true; infraFeatureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){ var popTotal = 0; for (var x = 0; x < results.length; x++) { popTotal = popTotal + results.attributes['POP2000']; } alert(popTotal); }); }