The easiest way to use your own maps in Tableau is by connecting to a WMS server or MapBox map. See Use WMS (Web Map Service) Servers and Use Mapbox Maps for more information.
If your map server does not support the WMS standard and is not a Mapbox map, you may still be able to connect to your map server by creating a connection from the Tableau Map Service (TMS). To connect to the TMS, create a .tms file.
Note: While a .tms file may be helpful in connecting to your map server, Tableau does not test or support .tms files, and success may vary.
To connect to your map server using a .tms, your map server must have the following features:
A .tms file is a simple text file that you can create in a text editor.
Open a text editor.
Copy and paste the following XML into the text editor.
<?xml version="1.0" encoding="utf-8"?>
<mapsource inline="<boolean>" version="8.1">
<connection class="OpenStreetMap" port="80" server="<server-url>" url-format="<url-format>" />
<layers>
<layer display-name='Base' name='base' show-ui='false' type='features' request-string='/' />
</layers>
</mapsource>
Replace <boolean>, <server-url>, and <url-format> variables as described in the "Required Variables in the TMS File" section in this article.
Save the TMS file with a .tms extension to the Mapsources folder of Tableau Desktop or Tableau Server.
The default location for the Mapsources folder:
For Tableau Desktop on the Mac - /Users/<user>/Documents/My Tableau Repository/Mapsources
For Tableau Desktop on Windows - C:\Users\<user>\Documents\My Tableau Repository\Mapsources
For Tableau Server - C:\ProgramData\Tableau\Tableau Server\data\tabsvc\vizqlserver\Mapsources OR /var/opt/tableau/tableau_server/data/tabsvc/vizqlserver/Mapsources
Open Tableau Desktop.
Connect to a workbook that contains location information.
Select Map > Background Maps, and then select the background map from the map server you configured in the TMS file.
(Optional) If you added the TMS file to the Mapsources folder in Tableau Server, publish the workbook to Tableau Server and see the background map you configured in the TMS file.
Only the following variables can be changed in the XML:
<boolean>: Replace the <boolean> with either a true or false value.
true value allows Tableau Desktop to save the configuration specified in the TMS file with the workbook. Use this value if your workbook is being published to Tableau Cloud or Tableau Public.false value requires Tableau Desktop or Tableau Server to have access to the TMS file saved in the Mapsources folder to display the maps from your map server.<server-url>: Replace <server-url> with the URL of your map server.<url-format>: Replace <url-format> with additional URL fragments that your map server requires. This might include the following tags:
{Z}: The {Z} tag indicates the zoom level. A zoom level of 0 displays the entire world in one map tile. The TMS will fetch map tiles up to level 16.{X} and {Y}: The {X} and {Y} tags indicate the map tile coordinates. For more information about map tiles, refer to the following web pages:
Suppose you want to connect to a sample map server provided by OpenStreetMaps. The TMS file may look like the following:
<?xml version="1.0" encoding="utf-8"?>
<mapsource inline="true" version="8.1">
<connection class="OpenStreetMap" port="80" server="http://a.tile.openstreetmap.org" url-format="/{Z}/{X}/{Y}.png" />
<layers>
<layer display-name='Base' name='base' show-ui='false' type='features' request-string='/' />
</layers>
</mapsource>
You can use the advanced TMS file format for special handling of API keys, and controlling the stretch, shrink, and washout of the map tiles.
Note: In the Mapsources folder you will find the TMS files that come with Tableau Desktop and Tableau Server. Settings that are configured in those files are not supported for connections to other map servers.
If your map server expects the API key in the server URL, you can use the {K} tag in the <url-format> section of the connection element.
You can also separate the API key from your <url-format> string by using the {K} tag in your string and placing the API key in the username attribute.
The following example demonstrates how to use the {K} tag with the API key in the username attribute.
<?xml version="1.0" encoding="utf-8"?>
<mapsource inline="true" version="8.1">
<connection class="OpenStreetMap" port="80" server="http://a.tile.mapbox.com" url-format="/v4/base.mapbox-streets+bg-e8e0d8_landuse_water_buildings_streets/{Z}/{X}/{Y}.png?access_token={K}" username="<your-api-key>"/>
<layers>
<layer display-name='Base' name='base' show-ui='false' type='features' request-string='/' />
</layers>
</mapsource>
By default, Tableau will take the map tiles it receives from the map server and stretch the map tiles to match your data. If you need more control over how your map tiles are displayed, you can set the maximum stretch, max-stretch, and the minimum shrink, min-shrink, attributes in the connection element.
If you set the maximum stretch and the minimum shrink to 1, Tableau does not stretch or shrink the map tiles. Instead, Tableau will snap the map zoom to the tiles. You can also set maximum stretch and minimum shrink attributes to values near 1 to allow some stretching or shrinking, as well as some snapping, depending on the zoom.
The following example demonstrates how to use the max-stretch and min-shrink attributes.
<?xml version="1.0" encoding="utf-8"?>
<mapsource inline="true" version="8.1">
<connection class="OpenStreetMap" port="80" server="http://a.tile.openstreetmap.org" url-format="/{Z}/{X}/{Y}.png" max-stretch="1.2" min-shrink="0.667"/>
<layers>
<layer display-name='Base' name='base' show-ui='false' type='features' request-string='/' />
</layers>
</mapsource>
By default Tableau will slightly wash out the map tiles it receives from the map server to make the data stand out. To control the level of washout of the map tiles, add the following section of XML directly before the closing tag of the root element, </mapsource> . You can change the washout value to any number from 0.0 to 1.0.
The following XML is an example of what can be placed before the closing tag of the root element, </mapsource>.
<mapsource-defaults version="8.1">
<style>
<style-rule element="map">
<format attr="washout" value="0.0"/>
</style-rule>
</style>
</mapsource-defaults>
001458061

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.