How to Use Google Maps in Tableau

Cody Schneider7 min read

While Tableau's built-in maps are powerful, sometimes you need the familiar detail of Google Maps as your background. Using a Google Map gives your audience instant context with its renowned street-level data, satellite views, and points of interest. This article will show you the most direct way to integrate Google Maps into your Tableau workbooks to create more intuitive and data-rich visualizations.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Use Google Maps in Tableau?

Tableau does an excellent job with its default map backgrounds, which are powered by OpenStreetMap. They're fast, clean, and great for most geographical analyses. However, there are a few distinct advantages to swapping in a Google Maps background:

  • User Familiarity: Almost everyone has used Google Maps. When your stakeholders see it in a dashboard, they immediately understand the context, making your data story easier to follow.
  • Greater Detail: Google Maps often provides a higher level of detail, including building footprints, specific business names, and rich terrain or satellite imagery that can add valuable context to your data.
  • Brand Consistency: If your company's website or other external reports use Google Maps, using it in your Tableau dashboards creates a consistent look and feel across all your materials.
  • Specific Features: Quick access to recognizable styles like transit maps, terrain views, and hyper-detailed satellite imagery can be invaluable for certain types of analysis, such as logistics, real estate, or environmental studies.

Integrating Google Maps bridges the gap between powerful data analytics and a universally understood geographical context, making your dashboards more effective and engaging.

The Easiest Method: Using a Tableau Map Source (.tms) File

The simplest and most reliable way to add Google Maps as a background in Tableau is by using a Tableau Map Source (.tms) file. Think of a .tms file as a tiny configuration file. It’s a simple text file written in XML that tells Tableau where to find the map images (called "tiles") and how to put them together to form a complete map.

By creating or downloading a .tms file configured for Google Maps, you can add it as a permanent option to Tableau's list of background maps.

Quick Disclaimer: Before proceeding, it’s a good practice to be aware of Google Maps' Terms of Service regarding direct tile access. The methods described here are primarily for educational and internal business intelligence purposes. For public-facing or commercial applications that rely heavily on the Google Maps Platform, you should consider using the official API through a Tableau Extension.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Step 1: Create the .tms File

You don't need to write any code yourself. The Tableau community has already created the necessary files. All you have to do is copy and paste the text into a plain text editor on your computer.

  1. Open a plain text editor like Notepad (Windows) or TextEdit (Mac). If using TextEdit on a Mac, make sure to switch it to "plain text" mode by selecting Format > Make Plain Text.
  2. Copy the code below for the standard Google Maps street view:

<pre><code>&lt,?xml version="1.0" encoding="utf-8"?&gt, &lt,mapsource inline="true" version="8.1"&gt, &lt,connection class="OpenStreetMap" port="80" server="http://mt0.google.com" url-format="/vt/lyrs=m&amp,hl=en&amp,x={X}&amp,y={Y}&amp,z={Z}" /&gt, &lt,layers&gt, &lt,layer display-name='Base' name='base' show-ui='false' type='features' /&gt, &lt,/layers&gt, &lt,/mapsource&gt,</code></pre>

  1. Save the file with the name GoogleStreet.tms. Make sure the file extension is .tms, not .txt or .xml.

You can create multiple files for different map styles by using slightly different URLs in the code. Here are a couple of popular options:

Google Maps Terrain

Save this as GoogleTerrain.tms:

<pre><code>&lt,?xml version="1.0" encoding="utf-8"?&gt, &lt,mapsource inline="true" version="8.1"&gt, &lt,connection class="OpenStreetMap" port="80" server="http://mt0.google.com" url-format="/vt/lyrs=p&amp,hl=en&amp,x={X}&amp,y={Y}&amp,z={Z}" /&gt, &lt,layers&gt, &lt,layer display-name='Base' name='base' show-ui='false' type='features' /&gt, &lt,/layers&gt, &lt,/mapsource&gt,</code></pre>

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Google Maps Satellite

Save this as GoogleSatellite.tms:

<pre><code>&lt,?xml version="1.0" encoding="utf-8"?&gt, &lt,mapsource inline="true" version="8.1"&gt, &lt,connection class="OpenStreetMap" port="80" server="http://mt0.google.com" url-format="/vt/lyrs=s&amp,hl=en&amp,x={X}&amp,y={Y}&amp,z={Z}" /&gt, &lt,layers&gt, &lt,layer display-name='Base' name='base' show-ui='false' type='features' /&gt, &lt,/layers&gt, &lt,/mapsource&gt,</code></pre>

Step 2: Add the .tms File to Your Tableau Repository

Tableau looks for custom map sources in a specific folder within your "My Tableau Repository" directory. You need to move the .tms file(s) you just created into this folder.

  • For Windows users, the path is: C:\Users\[Your Username]\Documents\My Tableau Repository\Mapsources
  • For Mac users, the path is: /Users/[Your Username]/Documents/My Tableau Repository/Mapsources

Simply drag and drop your saved .tms files into that folder.

Step 3: Restart Tableau and Select Your New Map

For Tableau to recognize the new map sources, you must close and re-open the application. If Tableau was open when you added the file, save your work and restart it.

Once you restart Tableau and open a workbook:

  1. Navigate to the top menu and click Map > Background Maps.
  2. You will now see your new Google Maps options in the list (e.g., GoogleStreet, GoogleTerrain, etc.).
  3. Click on one of them to set it as your background map.

That's all there is to it! Your worksheet will now use the Google Maps layer you selected as its default map background.

Building a Map Visualization with a Google Maps Background

Now that you've got Google Maps set up, let's create a quick map visualization to see it in action. We'll use the Sample - Superstore dataset that comes with Tableau.

  1. Connect to the Sample - Superstore data source.
  2. Create a new sheet.
  3. In the Data pane, find the geographic fields: Country, State, City, and Postal Code. Tableau identifies them with a small globe icon.
  4. Double-click on the State field. Tableau automatically creates a map, recognizes state names, and plots a point for each one.
  5. Change your background map to the GoogleStreet option you just added (via Map > Background Maps). You'll immediately see the data points plotted over the familiar Google Maps interface.
  6. Let's add more detail. Drag the Sales measure onto the Size button on the Marks card. The circles on the map will now get bigger based on total sales for each state.
  7. Next, drag the Profit measure onto the Color button on the Marks card. Tableau will color the circles based on profitability - by default, blue for profitable states and orange for unprofitable ones.

You now have a rich view of sales and profitability across the United States, all layered on top of a detailed and recognizable Google Map.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Tips for Better Maps

Once you have Google Maps as your canvas, you can use Tableau's formatting tools to make your data pop.

Adjust Layer Transparency

Sometimes, the map background can be a bit noisy. You can wash it out slightly to make your data marks clearer.

  • Go to Map > Map Layers...
  • A pane will open on the left-hand side. There, you'll see a slider for "Washout."
  • Increase the washout percentage to fade the background map, making your data points stand out more.

Use Tooltips Effectively

One of the best features of Tableau is the tooltip. Hovering over a data point (a state, in our example) shows a summary of its data. You can customize this to tell a more complete story.

  • Click on the Tooltip button on the Marks card.
  • In the editor that pops up, you can add more fields, rewrite the text, and change formatting to provide clear, at-a-glance information for your users. For instance, you could add the Number of Orders or Profit Ratio to give more context right on the map.

Final Thoughts

Bringing Google Maps into your Tableau dashboards is a fantastic way to enhance your geographical analysis with detailed, familiar map layers. Using a simple TMS configuration file, you can quickly add and reuse different map styles across all your workbooks, giving you more creative control over your visualizations.

At the end of the day, data analysis should deliver insights, not headaches from manual configuration. Here at Graphed, we believe in making this process as straightforward as possible. Instead of finding code snippets and setting up map files, you can simply connect your data sources to our platform. From there, you just ask our AI data analyst in plain English, "show my top 10 cities by sales on a map," and in seconds, an interactive map is ready for you. If a simple task like changing a map layer can feel clunky, just think about all the time spent on tougher recurring reports. With Graphed, you can get those hours back and focus on the insights, not the setup.

Related Articles