Reset map filtering when resetting selections

<?php
/** turn off map filtering when resetting the map facet **/
add_action('facetwp_scripts', function () {
?>
    <script>        
        (function($) {
            FWP.hooks.addAction('facetwp/reset', function() {
                $.each(FWP.facet_type, function(type, name) {
                    if ('map' === type) {
                        var $button = $('.facetwp-map-filtering');
                        $button.text(FWP_JSON['map']['filterText']);
                        FWP_MAP.is_filtering = false;
                        $button.toggleClass('enabled');
                    }
                });
            });
        })(fUtil);	
    </script>
<?php
}, 100);