Explain why Using and Combining Web Services

Explain why Using and Combining Web Services

Using and Combining Web Services

 

For this coursework you are to implement a web page that uses several different Google APIs and web services as well as the SunriseSunset API to provide information to travellers to New Zealand. This will consist of:

 

  • HTML without in-line formatting, and with well-formed open and closing tags for HTML elements
  • Cascading Style Sheets (CSS)

 

  • JavaScript to issue the requests to the APIs and handle returned data

 

  • DHTML so that all data is displayed without page reload

 

  • Requests to the following web services via library APIs:

 

  • maps

 

  • maps.geocoder

 

  • Use of cURL to make requests to the Google Places web service Note – this is mandatory – do not use the library API for this as was

 

shown in the lecture examples

 

  • Use of cURL to make requests to SunriseSunset

 

  • Data returned from the Google Places and SunriseSunset web services in JSON format
  • Use of objects to store data

 

 

 

Application description

  • the application will be implemented in the form of a dynamic web page

 

  • the user can enter the name of a town that they are interested in and a Google map of the area will be displayed as well as the times of day for sunrise and sunset in this town

 

  • the user can enter a type of business they are interested in and a list of these businesses in the selected town will be displayed

 

  • the user can click on one of the listed businesses and a marker will appear on the map showing its location

 

  • the application keeps track of towns the user has viewed and provides a list of these which can be clicked to redisplay the relevant map

 

 

For example, if the user enters “Auckland” as the town they are interested in, the web page may display something like:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then if the user enters “cafe” as the place of interest, the page displays:

 

 

and if the user clicks on the “Mezze Bar” listing, the page displays:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If the user then selects another town the map is replaced by the new map for the relevant town and all place and sunrise/sunset data is cleared. The new town is added to the list of Towns Viewed. The user can click on any of the listed towns viewed to repeat the map display for that town.

 

What you need to do:

 

  • Create a single HTML page which allows a user to enter the Name of a New Zealand town.

 

  • Each time the user enters a new town name it should be added to a clickable list of displayed town names. Within your JavaScript code you should create an object to store town information (name and geocodes) with any required functions.

 

  • Use the google.maps JavaScript API to display a map of the selected town, this will require the use of google.maps.Geocoder() to get the latitude and longitude, these are then used to create the map. Your map must include the necessary elements for a user to zoom in and out of the map (not shown in

 

the images above).

 

Details of how to use the google.maps API can be found at:

 

https://developers.google.com/maps/documentation/javascript/

 

(d) Use the SunriseSunset API with cUrl to find the sunrise and sunset times for the selected town and display this information on the page (this should not require further user interaction to achieve). Details of this API can be found at:

 

 

https://sunrise-sunset.org/api

 

  • Provide an input for a user to select a place of interest (type of business)

 

  • Use the Google Places API with cUrl requests to search for businesses of

 

the selected type in the selected location, again you will use the latitude and longitude as one of the search parameters. Your request should ask for the data to be returned as JSON. You will need to register for an API key for server requests and enable Google Places, details for registration can be found at:

 

https://developers.google.com/places/web-service/get-api-key

 

Details of how to use the Places web service can be found at: https://developers.google.com/places/web-service/intro

 

 

 

What to submit and how

All of your material for this assignment must be submitted electronically using Moodle.

 

Assuming that all parts of your application are within a directory called comp333assn3 within your course_html directory.

 

Compress this folder using gzip/zip etc. to create a comp333assn3.zip or comp333assn3.tar.gz file.

 

In the COMP333 Moodle site, you will see a link Assignment 3 to the submission page. This link allows you to upload your zip file. You can do this as many times as you want up to the submission deadline for the assignment.

 

When you submit a file Moodle will ask you to confirm that what you have submitted is your own work, and will provide you with a ‘receipt’ that

 

establishes that you have indeed submitted something. No other mechanism for submission will be accepted.

 

 

How your work will be assessed

 

The assignment will be marked out of 50 as follows:

 

•  Application meets minimum functional requirements                       20 marks

  • cUrl requests used to request and retrieve Places information

 

in JSON format 5 marks  
•  cUrl requests used to request and retrieve Sunset/Sunrise 5 marks  
information in JSON format 5 marks  
•  AJAX is used as appropriate for dynamic requests  
•  JavaScript object is used to store town information 5 marks  
•  HTML and CSS are used for appropriate design and layout 3 marks  
•  All code validates and is commented appropriately 3 marks  
•  Extra feature* 4 marks  

 

 

 

* For this assignment your additional feature must include the use of any additional (non Google and non Flickr) relevant web service to add more information or features to your page

Order from us and get better grades. We are the service you have been looking for.