fixed typo in AS Request file; Added init GetRequestUrl to LocationRecogRequest

This commit is contained in:
Christopher French 2018-08-27 16:13:44 -07:00
Родитель 08427ee1a4
Коммит 605084fe94
2 изменённых файлов: 23 добавлений и 7 удалений

Просмотреть файл

@ -87,13 +87,13 @@ namespace BingMapsRESTToolkit
switch(AutoLocation)
{
case .AutosuggestLocationType.userCircularMapView:
case AutosuggestLocationType.userCircularMapView:
locStr = string.Format("ucmv={0}", this.UserCircularMapView.ToString());
break;
case .AutosuggestLocationType.userMapView:
case AutosuggestLocationType.userMapView:
locStr = string.Format("umv={0}", this.UserMapView.ToString());
break;
case .AutosuggestLocationType.userLocation:
case AutosuggestLocationType.userLocation:
locStr = string.Format("ul={0}", this.UserLocation.ToString());
break;
}
@ -133,13 +133,13 @@ namespace BingMapsRESTToolkit
{
switch(entity_type)
{
case .AutosuggestEntityType.Address:
case AutosuggestEntityType.Address:
vals.Add("Address");
break;
case .AutosuggestEntityType.LocalBusiness:
case AutosuggestEntityType.LocalBusiness:
vals.Add("Business");
break;
case .AutosuggestEntityType.Place:
case AutosuggestEntityType.Place:
vals.Add("Place");
break;
}

Просмотреть файл

@ -29,6 +29,7 @@ namespace BingMapsRESTToolkit
_DistanceUnitType = DistanceUnitType.Kilometers;
Radius = .25;
Top = 20;
VerbosePlaceNames = false;
}
#endregion
@ -174,7 +175,22 @@ namespace BingMapsRESTToolkit
public override string GetRequestUrl()
{
throw new NotImplementedException();
string pointStr = string.Format("LocationRecog/{0}?", CenterPoint.ToString());
List<string> param_list = new List<string>
{
string.Format("r={0}", Radius.ToString()),
string.Format("top={0}", Top.ToString()),
string.Format("distanceUnit={0}", DistanceUnitTypeInput),
string.Format("verboseplacenames={0}", VerbosePlaceNames.ToString().ToLower()),
string.Format("key={0}", BingMapsKey.ToString()),
string.Format("includeEntityTypes={0}", IncludeEntityTypes)
};
if (this.DateTimeInput != null)
param_list.Add(string.Format("dateTime={0}", this.DateTimeInput.ToString()));
return this.Domain + pointStr + string.Join("&", param_list);
}
#endregion