Hi,
I have a graphics layer with polylines. How do I find the polylines in the graphics layer that intersect with an (x,y) point? I am using Flex API 1.3.
I have done something similar to the following but it does not work (all points are in projected mercator units):
public function FindIntersectingRoutes(mapPoint: Geometry): Array
{
var result: Array = new Array();
var allRoutes: Array = (myGraphicsLayer.graphicProvider as ArrayCollection).toArray();
for each (var g: Graphic in allRoutes)
{
var pt: MapPoint = (mapPoint as MapPoint);
var l: Polyline = g.geometry as Polyline;
if (l.extent.intersects(pt))
result.push(g);
}
return result;
}
Thanks.