Moving Beyond Tableau's Default Background Map

Version 2

    Tableau offers a host of features and one that I especially appreciate is their mapping.  They make it easy to analyze geospatial data.  As great as Tableau is,however, I sometimes want to add more "punch" to the background  map.  I have found two alternatives to Tableau's standard maps.


    Tableau’s map backgrounds are supplied by an online server.  You can select a different map server to provide background maps. Tableau supports two different map services besides their own, WMS and Mapbox.  WMS is Web Map Server and is a method of connecting to thousands of maps online.  Some are free and others require a subscription.  For me, this was a messy and complicated way to go since links are broken and quality maps are not assured.


    For me, Mapbox is a better alternative.  Mapbox is a subscription service but they also have free accounts with some limited capability.  First, sign up for a Mapbox account and then you will receive an API access token that you can use with Tableau to select different background maps.


    Next, open Map/Background Maps/Map Services.

    On the next window select Add to add a map service then choose Mapbox.

    Here is where you enter your token.  Choose the Classic tab and copy it in then press OK.


    Voila!  Now your background map has gone from this…

    to this!

    The beauty part is that Mapbox comes with several different map backgrounds that are useful out of the box.

    You might prefer “Outdoors”.

    I’ll leave exploring other options to you.  Another advantage of Mapbox is that you can customize your maps from within the Mapbox site using their Mapbox Studio.  Here you can change colors, fonts, the level of detail when zooming, etc.  That’s outside the scope of this tutorial so we’ll move onto another technique for mapping.


    As wonderful as Mapbox is you may have a specific map image you’d like to use to support a limited geographic area.  If that’s the case then Tableau has another trick up its sleeve, background images.  For example, maybe you’d like to overlay your Chicago data on one of the many images of Chicago neighborhood maps, like this one.

    The Chicago Data Portal has a data set of public art located in parks that includes latitude and longitude coordinates.  For this example, we’ll overlay the locations of the public art over a neighborhood map. Our first step is load the Chicago public art data into Tableau.  We see that among other variables it has longitude and latitude.  A few clicks later using their default map we have a viz like this (cropped for sizing).

    Now to add our Chicago neighborhood background image as a map we’ll need to tell Tableau the coordinate system.  The logical one for maps, of course, is latitude and longitude.  Tableau will want to know what the longitude range is from left to right and the latitude range from top to bottom.  We’ll need to figure out the latitude and longitude of two opposite corners of the neighborhood map.   Because of the inexact nature of the neighborhood map we’ll have to do some estimation.  There are several ways to do this but it all comes down to finding coordinates of a real map that approximates the neighborhood map.


    Tableau itself furnishes one way of doing this.  Right-click within the Tableau mapped and choose Annotate/Point.  By default Tableau furnishes the lat and long for a point in the text box.  Clicking on the text box will allow you to drag the point wherever you want on the map. For example, the approximate top left point, above and just to the left of O’Hare Airport, or the bottom right, just above Calumet City. Make a note of these coordinates, you’ll need them for the next step.

    Now select Map/Background Images.  Tableau will show you the name of the loaded data set(s) that the image should be applied to. Select the public art data set then select Add Image from the next window.  Browse to the location where you saved the map then add in the coordinates you found in the previous step.  Note that there is an option to increase the washout at the bottom.  You may want to use this so that that background image does not dominate the points plotted in Tableau.

    Click OK to close the window and OK again to return to Tableau.  At this point you’re probably still looking at Tableau’s default map.  That’s because you have not told Tableau yet that you want to use the background image.  To do that, go to Map/Background Maps and select None.  Voila!  Now you should have an image that looks something like this.

    If you look closely you’ll see that there are some points plotted in Lake Michigan.  The north/south coordinates look acceptable but we need to shift the map to the right slightly.  To estimate the fix you can zoom in on the waterfront and use the Annotate/Point to find the lat/long of where a give point should be. In the example below, I found a point in Lake Michigan offshore from the South Loop.  This is a memorial to firefighters on the backside of McCormick Plaza.  I used Annotate/Point to find an approximation of where it should be.  The difference in longitude is .0087 so I will add that value to both of the original longitude estimates to shift the map to the right.  (Note that longitude values in the US are negative so by adding we reduce the negative value thus moving it closer to the Prime Meridian in Greenwich, England).


    The revised map looks like this.  Depending on your level of comfort you may want to do some more slight tweaking of the latitudes and longitudes.  Otherwise with this image you can do the usual Tableau things and apply filters, change the shapes or colors of the mapped points, etc. You can also zoom in but if you zoom out there will be only white space beyond the borders of the Chicago neighborhood map.