Skip to content

Instantly share code, notes, and snippets.

@tugcearar
Created September 10, 2020 15:15
Show Gist options
  • Save tugcearar/437acac65c9688bcaf71666cca632ee1 to your computer and use it in GitHub Desktop.
Save tugcearar/437acac65c9688bcaf71666cca632ee1 to your computer and use it in GitHub Desktop.
public void NearbySearch(LatLng currentLocation, string searchText)
{
ISearchService searchService = SearchServiceFactory.Create(activity, Android.Net.Uri.Encode("YOUR_API_KEY"));
NearbySearchRequest nearbySearchRequest = new NearbySearchRequest();
nearbySearchRequest.Query = searchText;
nearbySearchRequest.Language = "en";
nearbySearchRequest.Location = new Coordinate(currentLocation.Latitude, currentLocation.Longitude);
nearbySearchRequest.Radius = (Integer)2000;
nearbySearchRequest.PageIndex = (Integer)1;
nearbySearchRequest.PageSize = (Integer)5;
nearbySearchRequest.PoiType = LocationType.Address;
searchService.NearbySearch(nearbySearchRequest, new QuerySuggestionResultListener(activity as MainActivity));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment