2) To find locations within a polygon:
var locs : GeoLocation[] = new GeoLocation[5];
locs[0] = new GeoLocation( map, "Redlands, CA", 34.0528, -117.1531);
locs[1] = new GeoLocation( map, "Loma Linda, CA", 34.0484, -117.2629);
locs[2] = new GeoLocation( map, "Bloomington, CA", 34.0704, -117.3976);
locs[3] = new GeoLocation( map, "San Bernardino, CA", 34.1214, -117.3046);
locs[4] = new GeoLocation( map, "Highland, CA", 34.1282, -117.2106);

var gp : GeoPointsImpl = new GeoPointsImpl();

for(var k : int  = 0; k < locs.Length; k++)
	gp.addPoint( locs[k].x, locs[k].y);

searchDef.addPolygon( gp, 0);

3) To find locations within a rectangle:

var locs : GeoLocation[] = new GeoLocation[2];
locs[0] = new GeoLocation( map, "San Bernardino, CA", 34.1214, -117.3046);
locs[1] = new GeoLocation( map, "Redlands, CA", 34.0528, -117.1531);

var rc : GeoRectangle = new GeoRectangle();
rc.left = locs[0].x;
rc.top = locs[0].y;
rc.right = locs[1].x;
rc.bottom = locs[1].y;

searchDef.addRectangle( rc, 0);

4) To find locations along a line:

var locs : GeoLocation[] = new GeoLocation[2];

locs[0] = new GeoLocation( map, "Redlands, CA", 34.0528, -117.1531);
locs[1] = new GeoLocation( map, "San Bernardino, CA", 34.1214, -117.3046);

var gp : GeoPointsImpl = new GeoPointsImpl();

for(var k : int = 0; k < locs.Length; k++)
	gp.addPoint( locs[k].x, locs[k].y);

searchDef.addLineBuffer( gp, map.convertDistance( 10, map.getMeasureUnits(), MeasureUnit.rmMapUnits), 0);

5) To find locations along a route:

var locs : GeoLocation[] = new GeoLocation[2];

locs[0] = new GeoLocation( map, "Redlands, CA", 34.0528, -117.1531);
locs[1] = new GeoLocation( map, "San Bernardino, CA", 34.1214, -117.3046);

// see the Routing section for details
var RouteID : String = findRoute( map, locs, 50, RoutingProblem.rmShortest, false);

searchDef.addRouteBuffer( RouteID, map.convertDistance( 10, map.getMeasureUnits(), MeasureUnit.rmMapUnits), 0);