facetwp redirect on marker click

<?php
/**
 * redirect to permalink on click of info marker instead of opening info window
 * Use the_permalink as the only content of your map facet marker content setting
 * https://d.pr/i/TTb4XW
 */
add_action( 'wp_footer', function() { ?>
    <style>
    .gm-style .gm-style-iw-a {display: none;}
    </style>
    <script>
    (function($) {
        if ('object' !== typeof FWP) {
                return;
        }
        $(function() {
            FWP.hooks.addAction('facetwp_map/marker/click', function( marker ) {
                window.location.href = marker.content;
            });
        });
    })(jQuery)
    </script>
<?php }, 100 );