2) To find locations within a polygon:
Dim locs() : ReDim locs(5)

Set locs(0) = new GeoLocation : locs(0).init "Redlands, CA", 34.0528, -117.1531
Set locs(1) = new GeoLocation : locs(1).init "Loma Linda, CA", 34.0484, -117.2629
Set locs(2) = new GeoLocation : locs(2).init "Bloomington, CA", 34.0704, -117.3976
Set locs(3) = new GeoLocation : locs(3).init "San Bernardino, CA", 34.1214, -117.3046
Set locs(4) = new GeoLocation : locs(4).init "Highland, CA", 34.1282, -117.2106

Set gp = Server.CreateObject("RMIMS.GeoPointsImpl")

For i = 0 To UBound( locs) - 1
    gp.addPoint locs(i).x, locs(i).y
Next

searchDef.addPolygon( gp), 0

3) To find locations within a rectangle:

Dim locs() : ReDim locs(2)
Set locs(0) = new GeoLocation : locs(0).init "San Bernardino, CA", 34.1214, -117.3046
Set locs(1) = new GeoLocation : locs(1).init "Redlands, CA", 34.0528, -117.1531

Set rc = Server.CreateObject("RMIMS.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:

Dim locs() : ReDim locs(2)

Set locs(0) = new GeoLocation : locs(0).init "Redlands, CA", 34.0528, -117.1531
Set locs(1) = new GeoLocation : locs(1).init "San Bernardino, CA", 34.1214, -117.3046

Set gp = Server.CreateObject("RMIMS.GeoPointsImpl")

For i = 0 To UBound( locs) - 1
    gp.addPoint locs(i).x, locs(i).y
Next	

searchDef.addLineBuffer (gp), Map.convertDistance( 10, Map.getMeasureUnits(), rmMapUnits), 0

5) To find locations along a route:

Dim locs() : ReDim locs(2)

Set locs(0) = new GeoLocation : locs(0).init "Redlands, CA", 34.0528, -117.1531
Set locs(1) = new GeoLocation : locs(1).init "San Bernardino, CA", 34.1214, -117.3046

' see the Routing section for details
RouteID = findRoute( locs)

searchDef.addRouteBuffer RouteID, Map.convertDistance( 10, Map.getMeasureUnits(), rmMapUnits), 0