Adding data layers to map

Map layers can change the way maps look in Tableau. There are map layers that change the style of the map to use either a light, normal, or dark background. There are also data layers that overlay additional information, such as place names or population, on top of the existing map.

In this recipe, we will add coastline, state/province borders, and household growth layers to the default map that comes with Tableau:

Adding data layers to map

Getting ready

To follow this recipe, open B05527_05 – STARTER.twbx. Use the worksheet called Map Data Layers, and connect to the States (catsvsdogs) data source:

Getting ready

How to do it...

Here are the steps to add more layers to the default Tableau map:

  1. Right-click on the Location field under Dimensions.
  2. Go to Geographic Role and select State/Province:
    How to do it...
  3. Double-click Location. Latitude (generated) is automatically placed in Rows and Longitude (generated) is automatically placed in Columns. The Location pill is also automatically placed in the Details property.
  4. Under the Marks card, click on the dropdown and change the mark to Shape:
    How to do it...
  5. From Measures, drag the calculated field Percentage to Shape in the Marks card.
  6. Click on the top-right drop-down arrow of the Shape legend and assign the following shapes from the Bars palette. To assign, click on a value on the left Select Data Item column, and then click on the appropriate icon you want to assign from the right column.
    How to do it...
  7. In this recipe, no shaded bars are assigned to 21-40%, and four shaded bars is assigned to > 60%.
  8. Click OK when done.
  9. Click on Size in the Marks card and move the slider to the right to make the icons on the map a little bit bigger.
  10. From Measures, drag the calculated field Percentage to Color in the Marks card.
  11. From Measures, drag the field Percentage of households with pets to Label in the Marks card.
  12. Go to the Map menu and select Map Layers:
    How to do it...
  13. In the Map Layers sidebar that appears, do the following:
    • Under Map Layers, check Coastline and State/Province Borders
    • Under Data Layer, select Housing Units Growth % 2016-2021
    • Under Data Layer, use the color palette Orange-Blue Diverging
    How to do it...
  14. Close the Map Layers sidebar when done.

How it works...

The default Tableau map comes with additional map and data layers. The data layers, however, are only available for US-related data.

To add the map and data layers, you simply need to go render the map in your view first, and then go to the Map menu and select Map Layers. The Map Layers pane will temporarily replace the data side bar.

The Map Layer allows additional information to be visualized onto the map, such as country/region names and borders:

How it works...

Like the map layers, the data layers add more encoding onto the map, such as population or income information for US locations:

How it works...

If you need data layers specific to your location or map, you may need to access your own GIS server that serves these extra map and data layers.

There's more...

The appearance of the maps can change subtly or dramatically depending on which layers you add. I encourage you to try out different combinations, and see which one can help deliver more impact to your dashboards.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.153.212