Select to view content in your preferred language

Change a graphic's geometry?

467
1
12-22-2011 11:48 AM
WesBailes
Occasional Contributor
Can someone assist me in changing a graphic's geometry, say from a point to a polygon after it gas been added to the graphics layer.  I can successfully change a graphic's symbol but not the geometry.
Tags (2)
0 Kudos
1 Reply
WesBailes
Occasional Contributor
Actually I got it working...Had an error in another function.  Here is the code if anyone ever needs it:

                                var g1:Graphic=findGraphicByAttribute(parcel);
    g1.geometry=pPolygon; //changed from a map point
    g1.symbol=parcelFillSymbol; 
    dispatchEvent(new LayerEvent(LayerEvent.UPDATE_END, myGraphicsLayer));

the function for finding the specific graphic:

                    public function findGraphicByAttribute( parcel:ClsParcel ) : Graphic
   {
    for each( var graphic : Graphic in myGraphicsLayer.graphicProvider)
    {
     if ( graphic.attributes.PARID == parcel.parid)
     {
      return graphic;
     }
    }  
    return null;
   }
0 Kudos