Thursday 20 December 2012

Google Fusion Tables Info Windows

A short post today related to info windows for Google Fusion Tables maps. In case you didn't know, an info window is what pops up when you click on an area of a Google map - as shown below. I've blogged about this in the past and today am sharing some more tips in relation to how to get a Google Street View snapshot of an area to appear in the info window. I just added this in to my new SIMD website.


This page tells you how to add a Street View snapshot and there isn't really much to it. You just need to make sure you have an API console key (baffled? see this for how to get one) which is just a key code that you need to make it work.  All you need to get one is a Google account. The other thing you'll need is two columns in your table specifying a latitude and longitude. I do this in ArcGIS before importing the data into Fusion Tables. Once you've done this you can add in the Street View code to the Fusion Tables info window layout (via Tools, Change info window layout... as below) and then add in the code via the Custom tab.



I've added in an Employment page to my new SIMD site where this is all put into practice - I have an info window chart, some data and a Google Street View snapshot in it, plus some text. Here's the code that makes it work - I'm certainly not a coding expert so apologies if it is a bit messy. If you're into this kind of thing, I hope you find it useful. 


You can change the dimensions from 400x400 to whatever you like. The curly brackets specify which column the lat/long comes from so you will need to make sure that this matches the name of your lat/long columns.

The only downside to this is that the image it displays is fairly random and not always representative of the area people click on. Sometimes, no image is available.