');
mapit(lat,lon,zoom,id);
}
function remove_map(id) {
$(id).remove();
}
//functions to handle the "more" link
// utility functions to create/remove camera info container
function get_exif(obj,id) {
//$(obj).parents().eq(2).append('
');
$(obj).parents().eq(3).append('
'); $(obj).parents().eq(2).children('.meta').clone().appendTo('#'+id).css('visibility', 'visible');
//deal with the variable height of div.legend
$('#exif-container').css({
bottom: function(index, value) {
return parseFloat($(obj).parent().parent().css("height"))-14;
}
});
}
function remove_exif(id) {
$('#'+id).remove();
}
$(document).ready(function(){
//set up click events for map button
$('.map-link').click( function() {
var more_id = 'more-container-'+$(this).parent().next().children('.more-link').attr('id').split('-')[1];
var id = '#map-container-'+$(this).attr('data-id');
if ($('#'+more_id).is(":visible")){
remove_exif(more_id);
}
if ($(id).is(":visible")) {
remove_map(id);
} else {
create_map($(this));
}
return false;
});
//set up click events for more info button
$('.more-link').click( function() {
var map_id = '#map-container-'+$(this).parent().prev().children('.map-link').attr('data-id');
var id = 'more-container-'+this.id.split('-')[1];
if ($(map_id).is(":visible")){
remove_map(map_id);
}
if ($('#'+id).is(":visible")) {
remove_exif(id);
} else {
get_exif(this, id);
}
return false;
});
});