facetwp map marker click hook

<?php
/** hook to add JS on opening map markers **/
add_action( 'wp_footer', function() { ?>
    <script>
    (function($) {
        if ('object' !== typeof FWP) {
                return;
        }
        
        $(function() {
            FWP.hooks.addAction('facetwp_map/marker/click', function( marker ) {
                // do stuff here
            });
        });
    })(jQuery)
    </script>
<?php }, 100 );