Parameters:
nFinder - number of a finder
For the USA map you can use the following constants:
ADDRESS = 0
INTERSECTION = 1
ZIP = 2
CITY = 3
COUNTY = 4
AREACODE = 5
COORDINATES = 6
Additional parameters depend on the amount and order of the fields of the specified finder.
For example, the ADDRESS finder has the following fields (the order of the fields is important):
'Address', 'ZIP', 'City', 'State'. Therefore, if you want to find an address you
must use the following syntax:
Dim fields : fields = Array( "380 New York St", "92373", "Redlands", "CA")
locs = findLocation( ADDRESS, fields)
Another examples:
Dim fields : fields = Array( "Redlands", "CA")
locs = findLocation( CITY, fields)
Dim fields : fields = Array( "Redlands")
locs = findLocation( CITY, fields) (found results equal Redlands, CA and Redlands, CO)
Dim fields : fields = Array( "Orange", "CA")
locs = findLocation( COUNTY, fields)
Dim fields : fields = Array( "New York St", "W Park Ave", "", "Redlands", "CA")
locs = findLocation( INTERSECTION, fields)
Returns:
An array of the FoundLocation objects, or null if the location is not found (see the FoundLocation object)
' Finders (USA map) Const ADDRESS = 0 Const INTERSECTION = 1 Const ZIP = 2 Const CITY = 3 Const COUNTY = 4 Const AREACODE = 5 Const COORDINATES = 6 // Finders (North American map) Const NA_US_ADDRESS = 0 Const NA_CA_ADDRESS = 1 Const NA_US_INTERSECTION = 2 Const NA_CA_INTERSECTION = 3 Const NA_US_ZIP = 4 Const NA_US_ZIP3 = 5 Const NA_CA_POSTALCODE = 6 Const NA_US_CITY = 7 Const NA_CA_CITY = 8 Const NA_US_COUNTY = 9 Const NA_AREACODE = 10 Const NA_COORDINATES = 11 Function findLocation( nFinder, fields) Dim rs, Finders, Finder Set Finders = Map.getFinders() Set Finder = Finders.getFinder( nFinder) For i = 0 To UBound( fields) Finder.setFieldValue i, fields(i) Next Set rs = Finder.find() If Not rs Is Nothing Then Dim Locations(), i ReDim Locations(rs.getRecordsCount - 1) i = 0 : rs.moveFirst Do Set Locations(i) = new FoundLocation Locations(i).init _ rs.getAsIntByName("SCORE"),_ rs.getAsStringByName( "NAME"),_ rs.getAsDoubleByName( "X"),_ rs.getAsDoubleByName( "Y"),_ rs.getAsDoubleByName( "LAT"),_ rs.getAsDoubleByName( "LONG") i = i + 1 Loop While rs.moveNext findLocation = Locations Else findLocation = null End IF End Function Class FoundLocation Public score Public label Public x Public y Public lat Public lon Public Function init( iscore, ilabel, ix, iy, ilat, ilon) score = iscore label = ilabel x = ix y = iy lat = ilat lon = ilon End Function End Class