private function onQueryExecuteComplete(event:QueryEvent):void { var fset:FeatureSet = event.featureSet; if(district1tool == true) { for each(var graphic:Graphic in fset.features) { graphic.name = graphic.attributes.PRECINCT for each(var graLyrGraphic:Graphic in myGraphicsLayer.graphicProvider) { if(graLyrGraphic.name == graphic.name) { for (var i:int = myGraphicsLayer.numGraphics - 1; i >= 0; i--) { if(myGraphicsLayer.graphicProvider.name == graphic.name) { if (district1tool == true) { dist1PopTotal -= myGraphicsLayer.graphicProvider.attributes.POPULATION myGraphicsLayer.remove(myGraphicsLayer.graphicProvider); return; } } } return; } } graphic.symbol = new SimpleFillSymbol('solid',0xcc0000,.7) myGraphicsLayer.add(graphic); dist1PopTotal+=graphic.attributes.POPULATION; } return; }
private function onQueryExecuteComplete(event:QueryEvent):void { var oneGraphic:Graphic = event.target as Graphic; var fset:FeatureSet = event.featureSet; for each (var graphic:Graphic in fset.features) { for each(var graLyrGraphic:Graphic in myGraphicsLayer.graphicProvider) { myInfo.text = "started loop"; if (graLyrGraphic.attributes === graphic.attributes) { myInfo.text = "found similar geometry"; //THIS IS WHERE I WOULD REMOVE THE GRAPHIC return; } } graphic.symbol = new SimpleFillSymbol('solid',0xcc0000,.7) myGraphicsLayer.add(graphic); dist1PopTotal+=graphic.attributes.POPULATION; } return; }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.