NOTE Since writing this post the company behind Truffler, 200OK, has been sold to EPiServer and the product Truffler has been renamed to EPiServer Find. Most of the content of this blog post is however applicable to EPiServer Find as well. For questions regarding Find, be sure to visit the forum on EPiServer World.
Leverage the powerful Within method in Truffler's .NET API to find locations within a geographical area drawn by users on a map.
During the weekend I finally got around to building a feature on the Truffler Sample site that I’ve been meaning to do for quite some time. I call it “crazy map search” as it’s A) probably not very useful in most applications and B) pretty darn cool.
For those that haven’t checked out the sample site yet, it demonstrates some of the search and filtering capabilities of Truffler by querying an index with a number of famous restaurants. The source code for the site is available for download on GitHub and it uses a read-only index so that anyone can download it and play with it without having to first create a Truffler index.
I grabbed the source code from one of the Google Maps samples that, among other things, show how to mark an area by placing a number of points on a map. I then stripped away the other examples, and adapted the code to perform a search for restaurants in the marked area. That is, as soon as at least three points have been added to the map and every time thereafter a point is added or moved the search result is updated to show restaurants within that area.
Check out Crazy map search here. And by all means, download the sample site and see what other geo search things you can come up with :)
- Truffler Sample – Example code and demo site
- Truffler update – dotting the i’s and crossing the t’s
- Introducing Truffler – Advanced search made easy
- Building a search page for an EPiServer site using Truffler - Part 2
- Cool new features in the Truffler .NET API
- Building a search page for an EPiServer 7 site with EPiServer Find
- Building a search page for an EPiServer site using Truffler
- Find greatness with EPiServer Find