/* ikkrom Google Maps */ //--------------------------------------------------------------------- // Define variables: var centre = new google.maps.LatLng(56.4500, -5.9700); var rosscentre = new google.maps.LatLng(56.31518, -6.32607); var cross = '/graphics/cross.png'; var map; var mapCreated = false; // Marker variables: var places = []; places[0] = new google.maps.LatLng(56.31631, -6.23380); places[1] = new google.maps.LatLng(56.32488, -6.34375); places[2] = new google.maps.LatLng(56.33254, -6.39409); var titles = []; titles[0] = 'Bunessan Church'; titles[1] = 'Creich Church'; titles[2] = 'Iona Parish Church'; var thumbs = []; thumbs[0] = 'img/tn/bunessanChurch.jpg'; thumbs[1] = 'img/tn/creichChurch.jpg'; thumbs[2] = 'img/tn/ionaChurch.jpg'; //-------------------------------------------------------------------- // Define Map options: var defOptions = { center: centre, zoom: 10, mapTypeId: google.maps.MapTypeId.TERRAIN } var rossOptions = { center: rosscentre, zoom: 12, mapTypeId: google.maps.MapTypeId.HYBRID } //-------------------------------------------------------------------- // INITIALISE MAP(s): function initialize(options) { if (!document.getElementById('map_canvas')) { makeDiv('map_canvas'); } map = new google.maps.Map(document.getElementById("map_canvas"), options); makeMarkers(); } //-------------------------------------------------------------------- // Create markers and Info Windows: function makeMarkers() { for (var i = 0, len = places.length; i < len; i++) { var marker = new google.maps.Marker({ position: places[i], map: map, icon: cross, title: titles[i] }); (function(i, marker) { google.maps.event.addListener(marker, 'click', function() { var infowindow = new google.maps.InfoWindow({ content: "
" + titles[i] + "
" }); infowindow.open(map, marker); }); })(i, marker); } } // //==================================================================== // Other functions function makeDiv(divId) { var mapdiv = document.createElement('div'); mapdiv.id = divId; // mapdiv.className = 'unseen'; var outerdiv = document.getElementById('outer'); var footer = outerdiv.getElementsByTagName('footer')[0]; outerdiv.insertBefore(mapdiv, footer); } function pageScroll() { window.scrollBy(0,600); // horizontal and vertical scroll increments }