The callback function for this method is not re-entrant. If an application calls Find before a previous Find call has returned the search results to the callback function, the first set of arguments are destroyed and are no longer available.
A Find call must include a non-null what parameter or non-null where parameter (or both).
If the Find call contains a non-null what parameter:
-
The map control returns a VEShapeLayer Class object as the first argument to the callback function. If the search is unsuccessful, this argument is . Otherwise, the pushpins that are returned as the second argument are all on this layer.
-
The map control returns an array of VEFindResult Class objects as the second argument to the callback function. If the search is unsuccessful, this argument is . Otherwise, each VEFindResult object contains a reference to a corresponding VEShape Class pushpin.
-
If a what parameter is specified, but the where parameter is , the current map view is used, even if the setBestMapView parameter is true.
-
If the numberOfResults parameter is set, it will limit the number of locations returned.
If the Find call provides a non-null where parameter:
-
The where parameter is overloaded. It can be either a String, representing a place such as "London" or "123 Main Street," a VEPlace Class object, or a VELatLongRectangle Class object. If it is a VEPlace object or a VELatLongRectangle object, then the what parameter must be non-null.
-
If the where parameter is a String, it is used to geocode a place name or an address.
-
The map control returns an array of VEPlace objects as the third argument to the callback function. If the search is unsuccessful, this argument is . Otherwise, these objects represent the possible location matches.
-
If more than one location matches the where search string, and the useDefaultDisambiguation parameter is true, the map control displays a disambiguation dialog box. The user must select a location from this dialog before the map control completes the search and calls the callback function.
-
If a where parameter is specified, the what parameter is null, and at least one of the VEPlace objects returned as the third argument to the callback function has a MatchConfidence property value of VEMatchConfidence.High, the map control does not display a disambiguation dialog box, even if the useDefaultDisambiguation parameter is true, but displays the first VEPlace object in the array. However, since all of the possible places are returned in the array, an application could build its own disambiguation dialog and query the user.
Localized search results can be returned by adding a mkt attribute to the map control reference. Information about returning localized results including supported cultures can be found in the Returning Localized Results topic.