Truffler Sample
  • Basic
  • Sorting
  • Paging
  • Highlighting
  • Filters
  • Facets
  • Autocomplete
  • Map

Map search Search by drawing a polygon on a map

Find restaurants within a given area by clicking in the map to add points that form an area. Adjust the area by dragging the points. Try an area in England for many hits.

View Source
var results = client.Search()
    .Filter(x => x.Coordinates.Within(points))
    .Select(x => new SearchHit
    {
        Title = x.Name,
        Url = x.Website ?? x.WikipediaUrl,
        Location = new List { x.StreetAddress, x.City, x.Country }.Concatenate(", "),
        MichelinRating = x.MichelinRating ?? 0
    })
    .GetResult();