5.4 Adding a Fusion Table Layer to your Maproom

Fusion tables offers a great alternative to adding your own data to your maproom.  Read the documentation on Google’s page to get acquainted with Fusion tables:

For this tutorial, we are going to take crime data that has been compiled in a google spreadsheet, and geocode the addresses, and map it using Google Fusion Tables.  We will then add the layer into our maproom.

  1. Sign into Google Docs.
  2. Access the tutorial class data.  This action alone will add this to your google docs list.
  3. Go back to your google docs home page, and click on CREATE, Table (beta).
  4. Select Google Spreadsheets, and choose Crime Sample UCLA.
  5. Verify the content of the spreadhseet, click next.  Confirm the name of the table, and click next again.
  6. Go to Visualize, Map.
  7. For the location dropdown, choose “Address”.  Fusion tables should start a geocoding task.
  8. Experiment with the different options that Fusion table gives you: configuring styles, infowindows, exporting to Google Earth, etc.  Remember that how you configure your map here will be how it shows up in your Maproom.

Adding the Fusion Table layer to your maproom

Now you are ready to add this layer to your maproom.

  1. Make your table public:  In order to add any fusion table to a Google Maps API page, you need to make it either public, or unlisted.  Click on the “share” button on the top right of the fusion table page, and select either “public” or “unlisted”.
  2. Identify the location column: In order to add a fusion table to your maproom, it needs to have a valid “location” column.  This is typically a latitude/longitude field, or in this case, the “address” column.
  3. Find the numeric ID: Now that your table is public (or unlisted), you will need to grab the ID of the table to use in your Google Maps code.  Go to File, About, and copy the Numeric ID number.
  4. The rest has to happen within the code for your maproom.  Much like adding a KML layer, adding a Fusion layer is done with just a few lines of code.  Note that the value for the “select” parameter is the location column identified in step 2, and the value for the “from” column is the Numeric ID identified in step 3:

(sample code)

Leave a Reply