Programming Assignment 3
Web Mashup: Display Best Restaurants on a Map

Due on Tuesday October 23 before midnight


The goal of this project is to create a web mashup that combines two web services: Google Maps and the Yelp API for Developers, using JavaScript and AJAX. After you center your Google Map to a geographical area and enter some terms, such as "Indian Restaurant", your application will find the best matches (eg, the best Indian restaurants) inside you map area, it will mark their location on the map, and will display some information about these restaurants on the web page.

This project must be done individually. No copying is permitted. Note: We will use a system for detecting software plagiarism, called Moss, which is an automatic system for determining the similarity of programs. That is, your program will be compared with the programs of the other students in class as well as with the programs submitted in previous years.

Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Just do your project alone using the help given in this project description and from your instructor and GTA only. Finally, you should not post your code nor deploy your project on a public web site.


As in Project #2, you will develop this project on your PC/laptop using XAMPP and you will test it using using your Mozilla Firefox web browser. Download and unzip it inside your web server document root directory. The project3 directory contains 3 files: proxy.php, yelp.html, and yelp.js. All the web service requests to should go through the proxy.php. See the example in yelp.js. Your project is to edit yelp.html and yelp.js as described in the description of the web application.

Web Services used by the Web Mashup

For this project, you will use the

First, you need to get API keys for both Google maps and Yelp:

Project Description

You need to edit the HTML file yelp.html and the JavaScript file yelp.js. Your HTML web page must have 3 sections:

  1. a search text area to put search terms with a button "Find"
  2. a Google map of size 600*500 pixels, initially centered at (32.75, -97.13) with zoom level 16
  3. a text display area

When you write some search terms in the search text area, say "Indian buffet", it will find the 10 best restaurants in the map area that match the search terms. They may be less than 10 (including zero) sometimes. The map will display the location of these restaurants as map overlay markers with labels from 1 to 10. The text display area will display various information about these restaurants. It will be an ordered list from 1 to 10 that correspond to the best 10 matches. Each list item in the display area will include the following information about the restaurant: the image "image_url", the "name" as a clickable "url" to the Yelp page of this restaurant, and the rating (a number between 1-5). When you search for new terms, it will clear the display area and all the map overlay markers, and will create new ones based on the new search.

Note that everything should be done asynchronously and your web page should never be redrawn completely. You need only one XMLHttpRequest object for sending a request to Yelp, since Google Maps is already asynchronous. You should not use any JavaScript library, such as JQuery.

What to Submit

Use the form below to submit your file. We do not accept email or hardcopy submissions. You may submit your files as many times as you like, but only the most recently submitted files will be retained and evaluated (newly submitted files replace the old files under the same file name). After you submit the files, please double-check that your submitted files are correct by clicking on the Status link.

Submit Project #3:

Last modified: 10/08/2018 by Leonidas Fegaras