Support » Plugin: iPanorama 360 WordPress Virtual Tour Builder » Track markers clicked?

  • Resolved spiirerichard

    (@spiirerichard)


    Is there a way to track if certain markers have been clicked?

    I noticed the markers have IDs. Is it possible to track which markers have been clicked or trigger clicks?

Viewing 1 replies (of 1 total)
  • Plugin Author Avirtum

    (@avirtum)

    Yes, it’s possible.

    
    var plugin = $('.ipanorama').ipanorama('instance');
    plugin.$container.on('click', '.ipnrm-marker', function(e) {
        var $marker = $(this),
        markerId = $marker.data('marker-id');
    
        var scene = plugin.viewer.sceneActive;
        var marker = null;
       
        for(var i=0;i<scene.ext.markers.length;i++) {
            marker = scene.ext.markers[i];
            if(marker.cfg.id == markerId) {
                break;
            }
        }
        
        if(marker) {
           console.log(marker.cfg);
           console.log(marker.cfg.userData);  
        }
    });
    
Viewing 1 replies (of 1 total)
  • The topic ‘Track markers clicked?’ is closed to new replies.