How To Add Google Maps To Your Review Site
« Review Foundry User Manual
Tutorial Table Of Contents
Obtain Review Foundry »
A Google Map is a graphical map of a geographic location which allows one to figure out exactly where a given location is, and how one might get there. In its usual incarnation, a Google Map looks a lot like the street maps of a U.S. Thomas Guide. You get street level details, green areas to represent parks, and so on.
Google generates these maps based on a set of latitudinal and longitudinal coordinates. However, latitude and longitude are not the friendliest pieces of data to work with if you are a human being. We are more used to street addresses and zipcodes (if you live in the U.S.). So Google offers an entire programming API to let you specify your geographic locations in the format you are most comfortable with. This information is converted to latitude and longitude behind the scenes. The process is known as geocoding. Review Foundry has its own geocoding interface, so that you can geocode existing records in bulk and add mapping capability to any reviewable thing that has an associated (and known) physical location.
For more about Google's implementation of its maps you can check out places like Wikipedia. The most important points are these: a Google Map can show computer-generated street maps, or it can show a photographic satellite image, or it can show a hybrid of the two (though the first format is by far the most useful to the average person looking up a location). Also, markers are deployed on the map to clearly specify the location of points of interest. In particular, it is possible to add multiple markers to show the location of several points of interest in the same map.
Yelp, if you have not come across it, is a popular website that caters to a community of users who enjoy reviewing "hotspots" in their local neighborhood. These hotspots are any locations of interest to other users, and constitute all kinds of businesses and leisure-based destinations. The most common type of business reviewed on Yelp is restaurants. People love to talk about their favorite feeding places!
At Yelp you can type an address into the search box and get back a list of hotspots for that location. Each hotspot is represented by a small triangular marker on a Google Map of the vicinity enclosing those hotspots. If you visit the detail page for one of the hotspots (see image to the right) you can read reviews about the hotspot that have been submitted by users.
The Yelp site has a very sosphistocated implementation of Google Maps. When you mouseover a marker, a popup appears with information about the corresponding hotspot. Click and you end up on the detail page for it. Also, by left-clicking the mouse on any portion of the map and holding down while you scroll, the area shown on the map can be changed, and new hotspots become visible on the map as their location enters the map window. On a page that lists hotspots in a location, the list itself automatically updates on the page. This is the power of Google Maps and the result of throwing several million dollars into a good idea :)
Well, neither you nor I have the several million dollars needed to come close to a Yelp-like interface. But when you use Review Foundry, and add your own Google Maps to your review pages, you can create something significantly improved over what you may already have. If you are offering reviews of any place that can be visited, you will find that activating Google Maps greatly enhances your pages. More on that later.
When you obtain the Geocoder module that has been written for Review Foundry, you can add some Yelp-like features to your review pages. For example, if you have been offering proximity-based searches which allow people to specify a U.S. zipcode, or a U.K. postcode, to get back a list of locations within X miles of that zipcode or postcode, now you can add a Google Map to the page which shows just where those locations are with respect to one another.
Imagine you are running a travel-related website where vistors can review the hotels in which they have stayed. When a reader finds a promising looking hotel they have access to a map of the surrounding area immediately on the page. They can zoom in to get a better idea of the exact location, or zoom out to clarify questions they may have on how to get there by using nearby freeways.
Yelp-like sites are sure to increase in popularity. But it might occur to you that if Yelp.com offers a way for users to review just about any location you can think of, why should you bother to offer a similar service. Well, the answer to that is same one that explains why Amazon.com isn't the only site on the web that offers product reviews. These sites are just too general. They do not focus on any particular niche, and because of that, the information they collect is likewise not nearly so focused. There is plenty of room for geographically-based review niches. In fact, it is an area of specialization that has barely been developed at all. Now, with Google Maps at your disposal, you can pursue this specialty area.
When you implement the Geocoder module in Review Foundry, you will get the same kinds of maps that you do with a site like Yelp.com--which is to say you will get mouseover popups and scrollable maps that allow you to zoom in and out. The only thing you won't get that might be nice is maps that automatically update the search results when you reposition them. Well, you never know. Maybe in a Review Foundry release much farther down the road...
To see what a Review Foundry site looks like with Google Maps added, take a look at the following page which represents a keyword search on the term child care for businesses within 10 miles of the Florida zipcode 34110. Click here for child care providers near zipcode 34110. This site, Consumer Raters was the first site to implement the Google Maps feature using Review Foundry. Notice how the map slides down the page as you scroll down. Popups on the map are activated either with mouseover events on the map markers, or by scrolling over the business names in the list on the left side of the page. Click on a map marker to go to the detail page for that business, and you will find another map showing the streets at just that business location. In general, a map can also be added to a business profile page, or appear in category listings for sites that group their items by geographic location (where a displayed map will cover a geographic region of limited area--rather than, say, the entire East or West Coast). You will notice that on ConsumerRaters.com there is no Google Map shown on any yellowpage (which lists businesses of a given type). This is because the yellowpages are not geographically constrained. Were a map displayed for one of these yellowpages it might have to straddle listings all across the United States. On the other hand, because all addresses are US based, proximity searches (find businesses with X miles of zipcode 12345) are possible--because they can be tied to zipcodes--and are offered on that site. See the next section for more information on when proximity searches can be used in conjunction with Google Maps.
The second site to implement the Google Maps feature using Review Foundry is the Backpackers Ultimate Guide. In contrast to the previous site, you can see an example of a Google Map that has been generated for businesses listed in a category. In this instance the map has been placed at the top of the page and does not slide. The businesses displayed are hostels in Washington, DC. The reason for implementing a non-sliding map is that the existing layout for the page did not leave room on the right for the map. Adding the map to the top of the page also allowed for larger map dimensions to be used. Clicking on the DC's Hilltop Hostel map marker brings you to the detail page for the hostel, and shows a large street level detail map for the vicinity around the hostel.
Note also that for this site the categories ARE constrained to cities, so it makes sense to offer a Google Map on these pages, which is why it has been done. But there is no proximity search offered on this site because addresses are international, and only US and UK proximity searches are offered for Review Foundry at the moment (see next section for the reasons) so the owner of the site has decided not to bother offering proximity searches for the small number of listings that have addresses in the US or UK.
Note that on pages where a Google Map is displayed, there is a Hide Map link that allows the mapping feature to be switched off across all pages on the site. This is useful if the visitor is finding that the maps are being rendered too slowly.
Proximity searches allow users to locate things (businesses usually) that have physical addresses within a given radius (measured in miles) from a specified physical location. So, for example, a user might want to find all pet shops located within 30 miles of the New York zipcode 10001. Such searches are very useful. But how do they work? And when can you expect to use them in combination with Google Maps?
Ideally one would hope that for every reviewable thing that appears in Review Foundry with a physical address, a proximity search could be used to find it. Particularly if its physical location can be tied down with a pair of latitude and longitude coordinates. Unfortunately, the computations required to determine the separation between arbitrary physical locations can be prohibitive. If every time you added a new thing to, say, your Item table, the distance between it and all of your standard locations had to be computed, that would be a real problem.
To get around this limitation, an approximation is performed. Instead of calculating the distance between your new Item and all other Items in the Item table, we approximate the calculation by asking what is the distance between the nearest standard location (to the given Item) and all other standard locations. The reason for doing this is that once we choose these standard locations we can do all the distance computations just once, cache them in a table, and do a lookup each time we need an answer. It's approximate, but quick, once the initial computations have been performed.
So how are the standard locations chosen? It's somewhat arbitrary, but using the location associated with a postcode is generally a good way to establish a set of standard locations. In the US, these postcodes are called zipcodes, and there are about 42,000 of them that cover the US. Once we know the latitude and longitude associated with each zipcode we can do all the intra-zipcode distance computations and store them away for later use. The table in Review Foundry that contains this information is called the ZipcodeNearby table. It is computed by running a special script from the command line, and generally takes several hours to run to completion. Once built, it can be used to find Items that are within X miles of a given zipcode (or central post office location). In Britian, the postcode system allows for a similar setup and British postcodes (about 2800 of them) and their latitude and longitude information can be setup with Review Foundry. To this point, these are the only two countries that have been integrated into Review Foundry.
Given that our standard locations are represented by zipcodes and postcodes, can we add a Google Map to the result of a proximity search? Yes. Provided the Items that are returned by a proximity search--meaning they share a zipcode or postcode in common with those returned by the search--have a latitude and longitude associated with them, a Google Map can be displayed showing the area surrounding them. So, no postcode system for a given country means no proximity searches, and therefor no Google Maps for displayed search results.
Next Section: ACTIVATING GOOGLE MAPS
Documentation for Review Foundry, which is entirely separate from these tutorial pages, is an ongoing project (as is this tutorial). You should find that there is sufficient information in the Review Foundry User Manual to answer most of your technical needs. Suggestions for improvement to both the User Manual and this tutorial are always welcomed. As more users gain experience with Review Foundry, and issues are resolved for its application in different areas, information gained from that experience will make its way into these pages.
Note: If you cannot find the information you are looking for in this tutorial, try the Review Foundry User Manual which you should find far more comprehensive than the instructional dialog found here.
Copyright © 2004 Random Mouse Software. All Rights Reserved.