public static AddressInfo GetAddressInfo(string AddressString) { IAddressQuery gc = new GoogleAddressQuery(); IAddressQuery yc = new YandexAddressQuery(); AddressInfo gai = null; try { gai = gc.GetAddressInfo(AddressString); } catch { } AddressInfo yai = null; try { yai = yc.GetAddressInfo(AddressString); } catch { } bool isGoogleKing = IsGoogleKing(AddressString); _lastQueryContext = isGoogleKing ? AddressInfoContextType.Google : AddressInfoContextType.Yandex; AddressInfo mainAi = isGoogleKing ? gai : yai; AddressInfo subAi = isGoogleKing ? yai : gai; if (mainAi != null) { if (subAi != null) mainAi.Merge(subAi); return mainAi; } else { return subAi; } }
public static AddressSuggestion[] GetCountrySuggestions(string Country, int MaxCount) { GoogleAddressQuery query = new GoogleAddressQuery(); return query.GetAddressesSuggestions(Country, null, null, MaxCount, AddressTargetType.Country); }