WDD 330: Web Frontend Development II

Web APIs

Overview

We have already worked with many APIs that are built into HTML. This learning activity focuses on a few Web APIs.

When writing code for the Web, there are a large number of Web APIs available. There are many APIs and interfaces (object types) that you may be able to use while developing your Web app or site. Web APIs are typically used with JavaScript, although this doesn't always have to be the case. - MDN Web Docs

Prepare

Activity Instructions

Geolocation API

  1. Navigate to w3schools.com Web APIs.
  2. Replicate the tutorial that uses the geolocation API to find the user's coordinate position in your own application.
  3. Add to the app by displaying an embedded map of the location on the page using any map source.

Canvas API

  1. Navigate to the MDN Canvas API tutorial.
  2. Complete the first two tutorial sections:
    1. Basic usage
    2. Drawing shapes
  3. Draw a happy face and a frowny face on a canvas. When clicked, toggle between the two faces.