Click or drag to resize

DrillDownGeoCoderBeginGetStreets Method

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Begins an asynchronous street search operation.

Namespace:  Telogis.GeoBase
Assembly: (in Version:
public IAsyncResult BeginGetStreets(
	string searchstring,
	AsyncCallback asyncCallback,
	Object asyncstate


Type: SystemString
The search term used to find streets.
Type: SystemAsyncCallback
Method to call when the search is complete.
Type: SystemObject
The state of the asynchronous search.

Return Value

Type: IAsyncResult
IAsyncResult allowing the caller to query the state of the search.

An asynchronous street search is performed using the drilldown geocoder's BeginGetStreets in conjunction with AbortGetStreets, and EndGetStreets. AbortGetStreets simply cancels an asynchronous street search operation; in the example below, it is used to cancel any previous search operation, so that we can safely start a new search.

BeginGetStreets will create a new thread and begin the search operation. When the search is complete, the callback function that is passed to BeginGetStreets is called. In the example below, the callback function (GetStreetsCallback(IAsyncResult searchResult)) calls UpdateStreetsList(), which in turn calls EndGetStreets to return the search results, once the search has completed, and populates the list box 'listBoxResults'.


This example assumes that the region levels, in the drill-down geocoder, have been set. It also assumes that we have a drilldown geocoder, called 'ddgc', and a list box to place the street search results in to, called 'listBoxResults'.

IAsyncResult asyncSearch;

private void searchSteets(string filterText){
 //Ensure previous asynchronous street search operation has stopped 

 //Begin the asynchronous search
 asyncSearch = ddgc.BeginGetStreets(filterText, getStreetsCallback, null);

private void getStreetsCallback(IAsyncResult searchResult) {

private void updateStreetsList() {
 if (InvokeRequired) {
  Invoke(new MethodInvoker(UpdateStreetsList));
 } else {
    StreetData[] sdlist = ddgc.EndGetStreets(asyncSearch).Results;
See Also