Pass variable to Info Window in FusionTableLayer
Posted
by
user1030205
on Stack Overflow
See other posts from Stack Overflow
or by user1030205
Published on 2012-06-08T14:38:45Z
Indexed on
2012/06/08
22:40 UTC
Read the original article
Hit count: 187
I am building a web application that includes a Google Map layered with data from a Google Fusion Table. I have defined the info window for the markers in the Fusion Table and all is rendering as expected, but I have one issue. I need to pass a session variable from my web application to be included in the links that are defined in the info window, but can't seem to find a way to do this. Below is the javascript I am currently using to render the map:
var myOptions = {
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: new google.maps.LatLng( 40.4230,-98.7372)
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
// Weather
weatherLayer = new google.maps.weather.WeatherLayer({
temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT
});
weatherLayer.setMap(map);
//Hobby Stores
var storeLayer = new google.maps.FusionTablesLayer({
query: { select: "col2", from: "3991553" },
map: map,
supressInfoWindows: true
});
//Club Sites
var siteLayer = new google.maps.FusionTablesLayer({
query: { select: "col13", from: "3855088" },
styles: [{ markerOptions: { iconName: "airports" }}],
map: map,
supressInfoWindows: true
});
I'd like to be able to pass some type of parameter in the call to google.maps.FusionTableLayer that passes a value to be include in the info window, but can't find a way to do this.
To view the actual page, visit www.dualrates.com. Enter your zipcode and select one of the airport markers to see the info window. You may have to zoom the map out to see an airfield.
© Stack Overflow or respective owner