Tableau + Google Maps
This has been one of my favorite Tableau tricks for a while. I originally saw Ben Jones do this a few years back but I think the Mapbox integration takes it to a whole new level. DISCLAIMER: from time to time, Google has been known to change their API, which inevitably breaks thousands of similar Tableau views. I’ll do my best to keep this page current.
The Google Part
- Go to the Google Developer’s Console and create a project. If you’ve got an account with Google, you’ve already go a developer’s account.
- In your project, you’ll need to enable a few APIs.
- Now, go to “credentials” on the side bar and find your API key, you’ll need this.
- Download one of the handy HTML templates and plug your API key in the line that says “YOUR API KEY HERE.” Note, one template is for directions and the other is for point point location using Street View.
The Tableau Part
Utilizing Tableau’s “URL actions,” the rest is very simple.
- Create a dashboard action that highlights the location and returns the latitude and longitude from a point map. Note, this works best if you have lat. and long. as part as your data as opposed to generated by Tableau.
- Find your HTML file and base URL. If it’s on your local system it will be something like:
file:///<path to file>/streetview.html?lat=<Latitude>&lon=<Longitude>
- Create a url action on the dashboard that passes the lat. and long. of your base URL.
- Click the “Web Page” function to add a page to the bottom of your dashboard using the generated URL.
- If you get stuck, just download the example from my Tableau Public page.
This example was part of presentation I gave for the Orlando Tableau Users Group. For a full copy of that presentation, you can download a zip file from my GitHub account (link below).
Other resources include:
Tableau Map Pack: Java tools for custom polygon creation with Tableau.
Flight Paths: A tutorial and workbook that creates distance paths using the “point order” technique.
World Series Ticket Prices: A wonderful view that uses custom polygons with the “point order” technique.
Mapbox: A wonderful tool for beautiful base maps that can be used in Tableau.