Tip: Merge tables to apply map styles by column

As introduced in set map styles, you can tell Fusion Tables to look in a particular column to determine the icon or color of map features. You can use the merge tables feature in Fusion Tables to quickly assign icon names or color names to rows in a table based on categories, and avoid laboriously editing the original table. 

Let's say that one column in your data always contains one of a short list of values. For example, it may contain either "Republican", "Democrat" or "Independent" like the Sponsoring party column shown below.

Event Location Sponsoring party
Rally in the Park 101 Park avenue, Maintown Democrat
Party Hearty 101 Main Street, Maintown Democrat
Rally Around Penthouse suite, Hotel Fancy, Maintown Republican
Rally in the Streets 300 Market Street, Maintown Republican
Fun Times 1000 Avenida Independencia, South Maintown Independent

You'd like to use a different icon for each row on the map:

  • Democrat: large_blue
  • Republican: large_red
  • Independent: large_yellow

If you create a second table with this legend and merge it with your original table, you'll have a new, merged table with the icons assigned to each category. You can then create a map and style it using the icon names column.

Instructions

These steps describe Classic Fusion Tables.
The same features are supported in the New look.

You do this in several phases:

  1. Create a second table with the legend information.
  2. Merge it with your original table.
  3. Map it and apply the icon style.

1. Create a second table with the legend

  1. Create a table similar to this one.
    It's easy to use Google Spreadsheets or any spreadsheet editor. The file can be a Google Spreadsheet, Excel spreadsheet, or .csv file. Make sure the text in the Category column exactly matches the entries in your original data table:
    Category Icon name
    Republican large_red
    Democrat large_blue
    Independent large_yellow

    To color a line or polygon instead, make a table like this one. In the "Color" column, use the hex code or color name. See how to style map for more details.
    Category Color
    Republican #FF0000
    Democrat #0000FF
    Independent #FFFF00
  2. Create a new Fusion Table by importing your new file.
  3. Copy the URL for this new table from the URL bar in your browser.

2. Merge it with your original table

  1. Open your original data table.
  2. Click Merge.
  3. Paste the URL into "merge with:" and click Get.
  4. On the left, select the radio button next to the column with categories.
  5. On the right, make sure the "Category" radio button is selected.
  6. Give the table a new name, and click "Merge."

The merged table will show the new column with a different background color. In our example:

Event Location Sponsoring party Icon name
Rally in the Park 101 Park avenue, Maintown Democrat large_blue
Party Hearty 101 Main Street, Maintown Democrat large_blue
Rally Around Penthouse suite, Hotel Fancy, Maintown Republican large_red
Rally in the Streets 300 Market Street, Maintown Republican large_red
Fun Times 1000 Avenida Independencia, South Maintown Independent large_yellow

3. Map it and apply the icon style.

  1. In the merged table, click Visualize > Map.
  2. Click "configure styles."
  3. With "Icon" or "Polygon fill" as appropriate selected on the left, click "by column."
  4. Make sure the radio button is selected next to "by column."
  5. Choose the new "Icon name" or "Color" column from the pull-down menu.
  6. Press Save.

Bonus! To change the icon style, simply edit the legend table. The map in the merged table will update the next time it is loaded.