Why isn't Drupal.gmap.addHandler() executed inside Drupal-behaviors?

Hi

I’ve made following javascript which works executes fine to the console.log but nothing after that is fired:

(function ($) {
    Drupal.behaviors.gmap = {
        attach: function (context, settigs) {
            console.log('attach'); // Work fine until this log
            Drupal.gmap.addHandler('gmap', function (elem) {
                console.log('this is not logged until moving between steps');
                var obj = this;
                var locations = [];
                var markers = [];

                function setValue() {
                    locations = [];
                    Object.keys(markers).forEach(function (marker) {
                        locations.push(markers[marker].position);
                    });

                    jQuery("input[name='submitted[locations][latlons]']").val(JSON.stringify(locations));
                }
...

However, this code is used in a multistep Webform and if I goto next step and come back then the second console.log is also executed.

And the second console.log of detach function doesn’t execute at all:

...
 detach: function (context, settings) {
            console.log('detach');
            jQuery('.gmap-processed').each(function (element) {
                console.log('detach 2');
                //find mapid
                var id = jQuery(this).attr('id');
                console.log(id);
                var mapid = id.split('-', 2);

                //unload map
                Drupal.gmap.unloadMap(mapid[1]);
            }).removeClass('gmap-processed');
        }
 }
})(jQuery)

I can use other method to add neede functionality and which work fine with attach detach.
This Drupal.gmap.addHandler is somehow different?

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed