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
- Reference Only: 📑 Web APIs - MDN
This reference list may help drive some thoughts on your own application build. - Read: 📃 Canvas API Tutorial - MDN
Activity Instructions
Geolocation API
- Navigate to w3schools.com Web APIs.
- Replicate the tutorial that uses the geolocation API to find the user's coordinate position in your own application.
- Add to the app by displaying an embedded map of the location on the page using any map source.
Canvas API
- Navigate to the MDN Canvas API tutorial.
- Complete the first two tutorial sections:
- Basic usage
- Drawing shapes
- Draw a happy face and a frowny face on a canvas. When clicked, toggle between the two faces.