var map1; function initialize() { var isDraggable = $(document).width() > 480 ? true : false; var latlng = new google.maps.LatLng(50.461514,-3.519891); var settings = { zoom: 15, scrollwheel: false, draggable: isDraggable, center: latlng, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP }; map1 = new google.maps.Map(document.getElementById("map_mini"), settings); var companyLogo = new google.maps.MarkerImage('/images/hollywood-marker-shadow.png'); var companyPos = new google.maps.LatLng(50.461514,-3.519891); var companyMarker = new google.maps.Marker({ position: companyPos, map: map1, icon: companyLogo }); } $(document).ready(function () { $(".centre_call a[href='#findus']").click(function(e) { e.preventDefault(); $("#map_mini").show(); var center = map1.getCenter(); google.maps.event.trigger(map1, "resize"); map1.setCenter(center); }); initialize(); });