I'm quite new to Google Fusion, but keen to learn. I've created a map, customized the infowindow and embedded the map onto my site using FusionTablesLayer Wizard to create a script to be hosted on the same domain. Doing it that way, I thougt it would be possible using target=_parent for my links in the infowindow in stead of the ever annoying target=_blank command. Since then I've found out, that due to security, you have to add a click listener to be able to get trget=_parent working, and this is where my abilities come to a stop. Can anyone help me enable the listener, configure the infowindow and most important of all, get target=_parent working.
Here's some code, I hope you can use.
Infowindow:
<div class='googft-info-window' style='font-family:Georgia, sans-serif' "width: 250px;" >
<base target="_parent" />
<b><a href="{info-URL} " ">{Skole}</a></b></b><br>
<i>Åbner i ny fane/nyt vindue</i><br><br>
{Adresse}<br><br>
<b>Elevtal:</b> {Elevtal}<br>
<b>Rang 2010/2011:</b> {Rangering til kort}/107<br><br>
<b>Gennemsnit 2010/2011</b><br>
<b>Dansk:</b> {Dansk total}<br>
<b>Engelsk:</b> {Engelsk total}<br>
<b>Fysik/kemi:</b> {Fysik/kemi total}<br>
<b>Matematik:</b> {Matematik total}<br><br>
<b>Samlet gennemsnit:</b> {Skolegennemsnit}<br><br>
{NOTE}<br><br>
<a href="{Skole-URL}" target=_blank>Hjemmeside</a>
</div>
FusionTablesLayer Wizard code
<!DOCTYPE html>
<html>
<head>
<base target="_parent" />
<style>
#map-canvas { width:700px; height:400px; }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var layerl0;
function initialize() {
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: new google.maps.LatLng(57.17199198214385, 9.771527295703208),
zoom: 8
});
var style = [
{
featureType: 'all',
elementType: 'all',
stylers: [
{ saturation: 9 }
]
}
];
var styledMapType = new google.maps.StyledMapType(style, {
map: map,
name: 'Styled Map'
});
map.mapTypes.set('map-style', styledMapType);
map.setMapTypeId('map-style');
layerl0 = new google.maps.FusionTablesLayer({
query: {
select: "'col2'",
from: 'table-id'
},
map: map,
styleId: -1,
templateId: 1
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
The map is online at www.skoleguide.net right now and the inspiration to add a click listener, I got from here
I really hope, someone out there can help me
Jens Skriver Steffensen