0

I amusing CartoDB 3.11.23 version. I have registered layer 'loading' event and 'load' event. It fires both for the first time. After I zoom in/out the map it fires only 'loading' but not 'load' event. Below is my code -

cartodb.createLayer(this.map, {
            user_name : cartoDBUser,
            type : 'cartodb',
            sublayers : [ {
                sql : <select query>,
                cartocss : '#dummy {polygon-opacity: 0.0;}'
            } ]
        }, {
            https : true,
            no_cdn: this.noCDN || false
        })
        .addTo(this.map)
        .on('done', onDone)
        .on('error', onError);

var onError = function() {
            this.alert('Map Error', 'There was a fatal error loading the map.');
        }, onDone = function(layer) {
            me.cartoLayer = layer;

            layer.bind('loading', function() {
                me.loader.show(); // THIS SHOWS THE LOADING SPINNER
            });

            layer.bind('load', function() {
                me.loader.hide(); // THIS HIDES THE SPINNER. BUT THIS IS NOT TRIGGERING
            });

            me.clearQueryMapArea();

            // Now add the viz
            me.addVisualization(viz);
        };

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.