Bird
Raised Fist0
Tableaubi_tool~10 mins

Map layers in Tableau - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a map layer showing state boundaries.

Tableau
MapLayers.AddLayer([1])
Drag options to blanks, or click blank then click option'
AStateBoundaries
BCityPoints
CCountryBorders
DPopulationHeatmap
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a layer that shows cities instead of states.
Using a heatmap layer instead of boundary lines.
2fill in blank
medium

Complete the code to set the map layer opacity to 50%.

Tableau
MapLayers.SetOpacity([1])
Drag options to blanks, or click blank then click option'
A0.5
B1.0
C0.75
D0.25
Attempts:
3 left
💡 Hint
Common Mistakes
Using 50 instead of 0.5 for opacity.
Choosing full opacity (1.0) instead of 50%.
3fill in blank
hard

Fix the error in the code to add a heatmap layer.

Tableau
MapLayers.AddLayer([1])
Drag options to blanks, or click blank then click option'
AHeatMapLayer
BHeatmap
CHeatmapLayer
DHeatmap_Layer
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect casing like HeatMapLayer.
Adding underscores in the layer name.
4fill in blank
hard

Fill both blanks to create a map layer with circle markers and set its color to blue.

Tableau
layer = MapLayers.CreateLayer([1])
layer.SetColor([2])
Drag options to blanks, or click blank then click option'
ACircleMarkers
BBlue
CRed
DSquareMarkers
Attempts:
3 left
💡 Hint
Common Mistakes
Using square markers instead of circles.
Setting the color to red instead of blue.
5fill in blank
hard

Fill all three blanks to add a polygon layer, set its fill color to green, and set opacity to 0.3.

Tableau
polyLayer = MapLayers.AddLayer([1])
polyLayer.SetFillColor([2])
polyLayer.SetOpacity([3])
Drag options to blanks, or click blank then click option'
APolygonLayer
BGreen
C0.3
DBlue
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong layer type like CircleMarkers.
Setting opacity to 1 instead of 0.3.
Choosing blue instead of green for fill color.

Practice

(1/5)
1. What is the main purpose of Map Layers in Tableau?
easy
A. To combine different types of data on a single map
B. To create bar charts from map data
C. To export maps as images
D. To filter data in tables

Solution

  1. Step 1: Understand the role of Map Layers

    Map Layers allow you to add multiple data types like points, colors, or shapes on one map.
  2. Step 2: Differentiate from other features

    Map Layers are not for charts, exporting, or filtering tables but for combining map data visually.
  3. Final Answer:

    To combine different types of data on a single map -> Option A
  4. Quick Check:

    Map Layers = Combine data on map [OK]
Hint: Map Layers = multiple data types on one map [OK]
Common Mistakes:
  • Confusing Map Layers with chart creation
  • Thinking Map Layers export maps
  • Assuming Map Layers filter tables
2. Which Tableau pane do you use to control the background details of a map?
easy
A. Filters shelf
B. Data pane
C. Marks card
D. Map Layers pane

Solution

  1. Step 1: Identify the pane for background map control

    The Map Layers pane lets you toggle streets, borders, and other background details on or off.
  2. Step 2: Differentiate from other panes

    The Data pane holds data fields, Marks card controls data visualization marks, and Filters shelf filters data, not background map details.
  3. Final Answer:

    Map Layers pane -> Option D
  4. Quick Check:

    Background control = Map Layers pane [OK]
Hint: Background map details = Map Layers pane [OK]
Common Mistakes:
  • Using Data pane for map backgrounds
  • Confusing Marks card with background control
  • Trying to filter background layers
3. Given a Tableau map with a filled map layer and a point layer added via the Marks card, what will happen if you remove the point layer from the Marks card?
medium
A. The filled map layer will disappear
B. Only the point markers will disappear, filled map remains
C. Both layers will remain unchanged
D. The map will switch to a table view

Solution

  1. Step 1: Understand layers added via Marks card

    Each layer added via the Marks card is independent; removing one removes only that layer.
  2. Step 2: Effect of removing point layer

    Removing the point layer removes only the points; the filled map layer remains visible.
  3. Final Answer:

    Only the point markers will disappear, filled map remains -> Option B
  4. Quick Check:

    Remove point layer = points gone, fill stays [OK]
Hint: Removing one Marks layer removes only that layer [OK]
Common Mistakes:
  • Assuming all layers disappear together
  • Thinking map switches to table view
  • Believing filled map depends on points
4. You added a polygon layer to your Tableau map but it does not display. What is the most likely cause?
medium
A. The Map Layers pane is turned off
B. You forgot to add a filter to the polygon layer
C. The polygon data is not properly connected or lacks geographic roles
D. Tableau does not support polygon layers

Solution

  1. Step 1: Check data connection and geographic roles

    Polygon layers require properly connected data with geographic roles assigned to draw shapes.
  2. Step 2: Eliminate other causes

    Map Layers pane controls background, not polygon visibility; filters are optional; Tableau supports polygons.
  3. Final Answer:

    The polygon data is not properly connected or lacks geographic roles -> Option C
  4. Quick Check:

    Polygon missing = data or geographic roles issue [OK]
Hint: Polygon layers need geographic roles assigned [OK]
Common Mistakes:
  • Turning off Map Layers pane expecting polygons to show
  • Assuming filters are mandatory for polygons
  • Believing Tableau can't show polygons
5. You want to create a map showing sales by state with colored filled areas and overlay customer locations as points. Which steps correctly use Tableau's Map Layers feature?
hard
A. Use the Marks card to create a filled map for sales, then add a point layer for customers; adjust Map Layers pane for background details
B. Create two separate worksheets, one for sales and one for customers, then combine them in a dashboard
C. Use only the Map Layers pane to add both sales and customer data layers
D. Add sales data as points and customer data as filled areas using the Filters shelf

Solution

  1. Step 1: Use Marks card for multiple layers

    Create a filled map layer for sales by state, then add a point layer for customer locations on the same map using the Marks card.
  2. Step 2: Adjust background with Map Layers pane

    Use the Map Layers pane to control background map details like streets or borders for better visualization.
  3. Final Answer:

    Use the Marks card to create a filled map for sales, then add a point layer for customers; adjust Map Layers pane for background details -> Option A
  4. Quick Check:

    Marks card layers + Map Layers pane = correct layering [OK]
Hint: Marks card for data layers, Map Layers pane for background [OK]
Common Mistakes:
  • Trying to add data layers only via Map Layers pane
  • Using separate worksheets instead of layers
  • Misusing Filters shelf for map layers