var venue = {}; if(window.GBrowserIsCompatible || GBrowserIsCompatible()) { $('body').addClass('has-googlemaps'); // class to the body for styling //$('
').attr('id','venue-map').appendTo($('#venue-container')); map = new GMap2($('#venue-map').get(0)); map.addControl(new GSmallMapControl()); //map.addControl(new GMapTypeControl()); setup_point = new GLatLng(53.75, -1.75); map.setCenter(setup_point, 6); $('body.venues #content-primary .venues').each(function(i) { $(this).find('h4 strong').remove(); venue[i] = $.trim($(this).find('h4').text()); lat = $(this).find('.latitude').text(); lon = $(this).find('.longitude').text(); postcode = $(this).find('.postcode').text(); point = new GLatLng(lat, lon); marker = new GMarker(point); this_zoom = map.getZoom(); map.addOverlay(marker); GEvent.addListener(marker, 'click', function() {marker.openInfoWindowHtml(venue[i]);}); $(this).find('h4').addClass('clickable').click(function() { clicked_lat = $(this).parent('.venues').find('.latitude').text(); clicked_lon = $(this).parent('.venues').find('.longitude').text(); clicked_point = new GLatLng(clicked_lat, clicked_lon); map.panTo(clicked_point); map.setZoom(10); }); }); }