Javascript Function Called Too Early in PHP Script

if u think that is the problem simply do:

$csf_map_output .= '<script>
jQuery(document).ready(function(){
    var csf_map_params=" .  json_encode( $atts ) .  ";
    csf_map_maker_js( csf_map_params );
});
</script>';

I don’t see any scope issues with the above code.