File: D:/web/itpartnership/google-map.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAnhhMp4xqWrLh7PM1dKEh6xTo6lRvBslUuB6llmQG7xaNNRuayRSwMKiuRHpBQgFr9EiOLebLfLLzZg" type="text/javascript"></script>
<!--#include file="inc-head.asp"-->
</head>
<body>
<div id="map" style="width: 500px; height: 500px"></div>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(-1.518, 52.2853), 2);
map.openInfoWindowHtml(map.getCenterLatLng(),
("<div style=\"white-space: nowrap; text-align: left;\"><strong>IT Partnership</strong><br />123 Radford Road<br /> Leamington Spa<br /> Warwickshire<br />CV31 1LG<br />01926 314011</div>"));
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
// this variable will collect the html which will eventually be placed in the sidebar
var sidebar_html = "";
// arrays to hold copies of the markers and html used by the sidebar
// because the function closure trick doesnt work there
var gmarkers = [];
var htmls = [];
var i = 0;
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
// FF 1.5 fix
html = '<div style="white-space:nowrap;">' + html + '</div>';
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
// save the info we need to use later for the sidebar
gmarkers[i] = marker;
htmls[i] = html;
// add a line to the sidebar html
sidebar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
i++;
return marker;
}
// This function picks up the click and opens the corresponding info window
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
// this bit creates the map
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(-1.518, 52.2853), 2);
// this adds the individual marker points
var point = new GPoint(-1.518, 52.2853);
var marker = createMarker(point,"ITP","<strong>IT Partnership</strong><br />123 Radford Road<br /> Leamington Spa<br /> Warwickshire<br />CV31 1LG<br />01926 314011")
map.addOverlay(marker);
// put the assembled sidebar_html contents into the sidebar div
document.getElementById("sidebar").innerHTML = sidebar_html;
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
//]]>
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4455167-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body>
</html>