function load() { if (GBrowserIsCompatible()) { var latlng = new GLatLng(50.68504,-3.46979); // Map lat/long var latlng2 = new GLatLng(50.68504,-3.46979); // Map lat/long var map = new GMap2(document.getElementById("map")); // Create new map object var map2 = new GMap2(document.getElementById("map2")); // Create new map object map.setCenter(latlng, 13); // Set center of map map.addControl(new GSmallMapControl()); // Add direction & zoom control map.addControl(new GMapTypeControl()); // Add map type control http://sk11.sinclaireknight.com/http://sk11.sinclaireknight.com/ map2.setCenter(latlng2, 13); // Set center of map map2.addControl(new GSmallMapControl()); // Add direction & zoom control map2.addControl(new GMapTypeControl()); // Add map type control directionsPanel = document.getElementById("route"); directionsPanel2 = document.getElementById("route2"); directions = new GDirections(map, directionsPanel); directions2 = new GDirections(map2, directionsPanel2); $('#get_dir').click(function(){ $('#route').slideDown(); $('#dir_close').show(); directions.load('from: ' + $('#loc_dir').val() + ' to: 50.68504,-3.46979'); }); $('#dir_close').click(function(){ $('#route').slideUp(); $(this).hide(); }); $('#get_dir2').click(function(){ $('#route2').slideDown(); $('#dir_close2').show(); directions2.load('from: ' + $('#loc_dir2').val() + ' to: 50.68504,-3.46979'); }); $('#dir_close2').click(function(){ $('#route2').slideUp(); $(this).hide(); }); var marker = new GMarker(latlng); // create new marker object using marker options var marker2 = new GMarker(latlng2); // create new marker object using marker options GEvent.addListener(marker, "click", function() { // add event listener to marker to detect clicking map.openInfoWindowHtml(latlng, document.getElementById('mapinfo').innerHTML); // open info window using innerhtml of div map.setCenter(latlng, 13); // Set center of map }); GEvent.addListener(marker2, "click", function() { // add event listener to marker to detect clicking map.openInfoWindowHtml(latlng2, document.getElementById('mapinfo2').innerHTML); // open info window using innerhtml of div map.setCenter(latlng2, 13); // Set center of map }); map.addOverlay(marker); // Add marker to map map2.addOverlay(marker2); // Add marker to map } }