var myGraphicPoint:Graphic = new Graphic(new MapPoint(o.X, o.Y, new SpatialReference(3857)));
protected function nameList_changeHandler(event:IndexChangeEvent):void { var selIndices:Vector.<int> = event.currentTarget.selectedIndices; var selItems:Vector.<Object> = event.currentTarget.selectedItems; var numItems:Number = selIndices.length; var myGraphicPoint:Graphic; //Clear GraphicsLayer addressGL_Select.clear(); for (var ix:Number = 0; ix<numItems; ix++) { var cl:ArrayCollection=new ArrayCollection; cl.addItem(selItems[ix]); //CL and Add to Map for(var i:int = 0; i < cl.length; i++) { var o:Object = cl.getItemAt(i); myGraphicPoint = new Graphic(new MapPoint(o.X, o.Y, new SpatialReference(3857))); myGraphicPoint.symbol = BluDiamont; addressGL_Select.add(myGraphicPoint); } } selectList.addItem(nameList.selectedItem); }
for(var i:int = myGL.graphicProvider.length - 1; i >= 0; i--) { var gra:Graphic = myGL.graphicProvider as Graphic; //if some condition is true then remove the graphic from the GL if(gra.attributes.name == "some name"){ myGL.remove(gra); } }
protected function nameList_changeHandler(event:IndexChangeEvent):void { if(nameList.selectedIndex >= 0) { for(var i:int = 0; i < nameList.dataProvider.length; i++) { var o:Object = nameList.dataProvider.getItemAt(i); //trace(o.lastName); if (o.lastName==nameList.selectedItem.lastName) { var myGraphicPoint:Graphic = new Graphic(new MapPoint(o.X, o.Y, new SpatialReference(3857))); myGraphicPoint.symbol = BluDiamont; addressGL_Select.add(myGraphicPoint) } else { myGraphicPoint.symbol = sms1; } //nameList.dataProvider=null; } } }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.