jQuery(function($) {

    // Now initialise the map
    var mapstraction = new Mapstraction('map','google');
    mapstraction.addControls({
        zoom: 'small',
        map_type: true
    });

    mapstraction.setCenterAndZoom(new LatLonPoint(54.7246201949245, -2.5927734375), 5);

    // Geocode hcard and add a marker
    jQuery('.vcard.venue').each(function() {
        var hcard = jQuery(this);
    
        var venue = hcard.find('.fn .org').text();
        var streetaddress = hcard.find('.street-address').text();
        var postcode = hcard.find('.postal-code').text();
    
        var geocoder = new MapstractionGeocoder(function(result) {
            var marker = new Marker(result.point);
            mapstraction.addMarker(marker);
        }, 'google');    
        geocoder.geocode({'address': venue + ', ' + postcode});
    });
});

