Select to view content in your preferred language

Buffer multiple points - NON-SFV convert from 1.3 to 2.0

616
2
08-31-2010 06:38 AM
CarmenDurham
Frequent Contributor
Hello,

I'm still converting a non-SFV flex app fro 1.3 to 2.0, FB4 and SDK4 (with 9.31 services).

Using a buffer geometry service that buffers multiple address points by 500ft and then select fire hydrants within that distance.  Worked in 1.3.  Process will work in 2.0 if I just have one address, the issue is multiple addresses. 

1.3 code ( fullAddressGraphictoBuffer:Array and addressLayer: GraphicsLayer):
 fullAddressGraphictoBuffer = ArrayCollection(addressLayer.graphicProvider).toArray();
 var bufferParameters:BufferParameters = new BufferParameters();
 bufferParameters.features = fullAddressGraphictoBuffer;



2.0 code -  I think it has something to do with the fullAddressGraphictoBuffer being an array of graphics vs. geometries, but I don't know how to "get to" the geometries of a graphicsLayer. 

 fullAddressGraphictoBuffer = ArrayCollection(addressLayer.graphicProvider).toArray();
  var bufferParameters:BufferParameters = new BufferParameters();
  bufferParameters.geometries = fullAddressGraphictoBuffer; 
// this works for single address bufferParameters.geometries = [lastAddressGraphic.geometry];


Is this where featureLayer may work better?
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Carmen,

   You just have to loop through the graphicsProvider and create an array of geometries from it.

var geoArray:Array = [];
for each(var gra:Graphic in fullAddressGraphictoBuffer){
    geoArray.push(gra.geometry);
}
bufferParameters.geometries = geoArray;
0 Kudos
CarmenDurham
Frequent Contributor
Thanks Robert!  Worked like a charm.

Carmen
0 Kudos