
//google maps api js

var map;    
function init() {     
    //uk
    var latlng = new google.maps.LatLng(54.977614, -3.924609 );

    var myOptions = {
        zoom: 14,            
        center: latlng,
        mapTypeId: google.maps.MapTypeId.SATELLITE,
        
        scaleControl: true
      };
                          
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);      
 }    
 
function placeMarker(latLng, title, infoContent) { 
    var image = "images/wcc-map-logo.gif";  
                                                
    var marker = new google.maps.Marker({
        position: latLng,
        title: title,        
        map: map            
    });
    
    var infowindow = new google.maps.InfoWindow ({
        content: infoContent,                
        maxWidth: 200
    });

    google.maps.event.addListener(marker, 'click', function () {
        //dm - changed to fix centering of marker
        infowindow.setPosition(marker.getPosition());
        infowindow.open(map);
        //infowindow.open(map, marker);             
    });
    
    var infoPos = infowindow.getPosition();

    //dm - changed to fix centering of marker
    infowindow.setPosition(marker.getPosition());
    infowindow.open(map);    
    map.setCenter(infowindow.getPosition());
    
    //infowindow.open(map, marker);                                                  
}

function centerMap(latLng) {
    //unused
    map.setCenter(latLng);
    map.zoom = 14;
}

                               
$(function() {
    //set-up the map        
    init();        
});
