Advanced Interactive Web Mapping, Programming, and Design

In-class Excercises: APIs continued

Part 1: Adding data to your page

  1. Write an SQL query that selects the distinct neighborhood names from the Airbnb listings you have loaded in CartoDB.
  2. Test the SQL query in CartoDB to confirm that it works.
  3. Using this jsbin as an example, use the CartoDB SQL API and jQuery to add the neighborhood names as option elements in a select element.

Part 2: Dynamic data on Leaflet

  1. Check out the documentation for Leaflet GeoJSON layers.
  2. Starting with this example, load data from your table of Airbnb data in CartoDB on the map.
  3. When you are done, you should still be able to change the dropdown to change how much data appears.

Part 3: Mapzen Search and Leaflet

  1. Go to Mapzen Developers and get an API key for Mapzen Search.
  2. Open the API documentation for Mapzen Search.
  3. Using your browser or Postman, test your knowledge of the API to search for a few places such as your address.
  4. Using this template as a starting point, call the Mapzen Search API with one of the queries from the previous step and show the results on the map.