/// <summary> /// Gets the base request URL. /// </summary> /// <returns>The base request URL.</returns> internal string GetBaseRequestUrl() { var url = string.Empty; if (!string.IsNullOrWhiteSpace(Culture)) { url += "&c=" + Culture; } if (UserMapView != null) { //South Latitude, West Longitude, North Latitude, East Longitude url += string.Format("&umv={0}", UserMapView.ToString()); } if (UserLocation != null) { url += string.Format("&ul={0}", UserLocation); } if (!string.IsNullOrWhiteSpace(UserIp)) { url += "&uip=" + UserIp; } return(url + "&key=" + BingMapsKey + "&clientApi=" + InternalSettings.ClientApi); }
public override string GetRequestUrl() { if (Query == "") { throw new Exception("Empty Query value in Autosuggest REST Request"); } string queryStr = string.Format("q={0}", Uri.EscapeDataString(Query)); string maxStr = string.Format("maxRes={0}", (max_maxResults < MaxResults) ? max_maxResults : MaxResults); string locStr = null; switch (AutoLocation) { case AutosuggestLocationType.userCircularMapView: locStr = string.Format("ucmv={0}", UserCircularMapView.ToString()); break; case AutosuggestLocationType.userMapView: locStr = string.Format("umv={0}", UserMapView.ToString()); break; case AutosuggestLocationType.userLocation: if (UserLoc == null) { throw new Exception("User Location is Requred"); } locStr = string.Format("ul={0}", UserLoc.ToString()); break; } string inclEntityStr = string.Format("inclenttype={0}", getIncludeEntityTypeString()); string cultureStr = string.Format("c={0}", Culture.ToString()); List <string> param_list = new List <string> { queryStr, locStr, inclEntityStr, cultureStr, maxStr, string.Format("key={0}", BingMapsKey) }; if (CountryFilter != null) { string country_filterStr = string.Format("cf={0}", CountryFilter.ToString()); param_list.Add(country_filterStr); } return(Domain + "Autosuggest?" + string.Join("&", param_list)); }