protected function btn_loadMap_clickHandler(event:MouseEvent):void { if (categoryList.selectedIndex > -1 ) { //must have selected something from the dropdownlist category = categoryList.selectedItem.data; } if ( mapList.selectedIndex > -1) { mapChoice = mapList.selectedItem.data; } if (!category || !mapChoice) { Alert.show("Please select both a chemical use and map type.", "Need Selections to Generate Map"); } yearValue = radio_yearButtons.selectedValue; if (categoryList.selectedIndex > -1 && mapList.selectedIndex > -1) { classBreakField = category + "_" + yearValue + "_" + mapChoice; mapTitle.text = yearValue + " - " + categoryArrayObj[category] + ", " + mapTopicArrayObj[mapChoice]; lblLegend.text = mapTopicArrayObj[mapChoice] + " - " + yearValue; qryTask_selectedField(); } }private function qryTask_selectedField ():void { trace ("in qrytask_selectedField function"); graphicsLayer.clear(); mainMap.infoWindow.hide(); var coQryTask:QueryTask = new QueryTask (); coQryTask.showBusyCursor = true; coQuery.geometry = mainMap.extent; coQryTask.useAMF=false; coQryTask.url = "http://" + localpathName + "/arcgis/rest/services/EPHT_AgChemical_county/MapServer/0" coQryTask.addEventListener(QueryEvent.EXECUTE_COMPLETE, coResult); coQryTask.addEventListener(FaultEvent.FAULT, onFault); coQryTask.execute(coQuery); //coQryTask.execute(coQuery, new AsyncResponder( coResult, onFault )); }<s:Label id="lbl_featureCount" text="Number of features from query:" fontStyle="italic" />
Solved! Go to Solution.
coQuery.geometry = mainMap.extent;
coQuery.geometry = mainMap.extent;