AutocompleteGeocoderGeocode Method (AutocompleteGeocoderBaseArgs) |
Namespace: Telogis.GeoBase.Geocoding
AutocompleteGeocodeArgs args = new AutocompleteGeocodeArgs("20 Enterprise, Aliso", Country.USA, LatLon.Empty, TimeSpan.FromSeconds(1)); AutocompleteGeocoderResult result = AutocompleteGeocoder.Geocode(args); if (result.Status == SearchResult.SearchCompleted && result.Suggestions.Length == 0) { Console.WriteLine("No results found."); } else if (result.Status == SearchCancelled) { Console.WriteLine("Search was canceled."); } else { if (result.Status == SearchResult.TooManyResults || result.Status == SearchResult.Timeout) { Console.WriteLine("Too many results for the string provided. Further qualify the address to see further suggestions."); } else if (result.Status == SearchResult.SearchCompleted) { Console.WriteLine("Search completed."); } foreach (AutocompleteGeocoderSuggestion suggestion in result.Suggestions) { Console.WriteLine(suggestion.ToString()); } }