function create_hotspot(data) {
        // Hotspot's geometry and type - corresponds with the model
        var geometry    = data.geometry || 'dot'
        ,   type        = data.type || 'nav'
        
        // The index for the hotspot inside the hotspot array
        ,   ix          = $hotspots.length
        
        // Create the hotspot and the handle
        ,   $hotspot    = div({class: 'leanorama-hotspot leanorama-hotspot-' + geometry, id: data.id})
        ,   $handle     = div({class: 'leanorama-hotspot-handle'})
        ,   $handle_inner = div({class: 'leanorama-hotspot-handle-' + type, id: data.id + '_handle'})
        ;
        
        var title;
        
        switch (type) {
            // Handle the navigational hotspots
            case 'nav':
                title = data.name || 'Go to';
                
                $handle_inner.attr('rel', 'tooltip')
                             .attr('data-html', true)
                             .attr('data-original-title', title);
                             
                break;
            // Handle the informational hotspots
            case 'info':
                var closebtn = '<span class="btn btn-mini btn-danger" style="float: right;" onclick="$(\'#' + data.id + '_handle\').popover(\'hide\');">x</span>';
                title = '<b>' + (data.name || 'Information') + '</b>' + closebtn;
                var content = data.value || data.name || 'N/A';
                
                $handle_inner.attr('rel', 'popover')
                             .attr('data-html', true)
                             .attr('data-original-title', title)
                             .attr('data-content', content);
                break;

            // Handle the link hotspots
            case 'link':
                title = data.name || 'Link';

                $handle_inner.attr('rel', 'tooltip')
                             .attr('data-html', true)
                             .attr('data-original-title', title)
                             .click(function() { window.open(data.value, '_blank'); });
                break;

            // Handle the actionable hotspots
            case 'action':
                title = data.name || 'Turn On/Off';

                $handle_inner.attr('rel', 'tooltip')
                             .attr('trigger', 'manual')
                             .attr('data-placement', 'bottom')
                             .attr('data-html', true)
                             .attr('data-original-title', title);
                break;
        }
        
        // Append the hotspot to the face it belongs, and place it where it should be
        this.$sides[data.face].append($hotspot);
        $hotspot.css({top: data.y, left: data.x});
        
        // Construct hotspot layer on the panorama
        this.$el.append($handle.append($handle_inner));
        
        // Init the relevant Bootstrap objects for the hotspots
        $('.leanorama-hotspot-handle-info').popover();
        $('.leanorama-hotspot-handle-nav').tooltip();
        $('.leanorama-hotspot-handle-link').tooltip();
    
        $handle.bind('touchend click', $.proxy(function() {
            // TODO: For touch event - check that on touchend the finger is still
            //       on the hotspot, otherwise don't trigger the event.
            this.$el.trigger(this.EV_HOTSPOT_CLICK, [data]);
        }, this));
        
        // Add hotspot to the hotspot array
        $hotspots[ix] = { hotspot: $hotspot, data: data, handle: $handle };
        
        // Fugly fugly hack hack hack!!!
        this.lon += 0.01;
    }
// Create a hotspot on panorama's surface
Create a hotspot on panorama's surface
Create a hotspot on panorama ' s surface
function create_hotspot(data) {
        var geometry    = data.geometry || 'dot'
        ,   type        = data.type || 'nav'
        ,   ix          = $hotspots.length
        ,   $hotspot    = div({class: 'leanorama-hotspot leanorama-hotspot-' + geometry, id: data.id})
        ,   $handle     = div({class: 'leanorama-hotspot-handle'})
        ,   $handle_inner = div({class: 'leanorama-hotspot-handle-' + type, id: data.id + '_handle'})
        ;
        var title;
        switch (type) {
            case 'nav':
                title = data.name || 'Go to';
                $handle_inner.attr('rel', 'tooltip')
                             .attr('data-html', true)
                             .attr('data-original-title', title);
                break;
            case 'info':
                var closebtn = '<span class="btn btn-mini btn-danger" style="float: right;" onclick="$(\'#' + data.id + '_handle\').popover(\'hide\');">x</span>';
                title = '<b>' + (data.name || 'Information') + '</b>' + closebtn;
                var content = data.value || data.name || 'N/A';
                $handle_inner.attr('rel', 'popover')
                             .attr('data-html', true)
                             .attr('data-original-title', title)
                             .attr('data-content', content);
                break;
            case 'link':
                title = data.name || 'Link';
                $handle_inner.attr('rel', 'tooltip')
                             .attr('data-html', true)
                             .attr('data-original-title', title)
                             .click(function() { window.open(data.value, '_blank'); });
                break;
            case 'action':
                title = data.name || 'Turn On/Off';
                $handle_inner.attr('rel', 'tooltip')
                             .attr('trigger', 'manual')
                             .attr('data-placement', 'bottom')
                             .attr('data-html', true)
                             .attr('data-original-title', title);
                break;
        }
        this.$sides[data.face].append($hotspot);
        $hotspot.css({top: data.y, left: data.x});
        this.$el.append($handle.append($handle_inner));
        $('.leanorama-hotspot-handle-info').popover();
        $('.leanorama-hotspot-handle-nav').tooltip();
        $('.leanorama-hotspot-handle-link').tooltip();
        $handle.bind('touchend click', $.proxy(function() {
            this.$el.trigger(this.EV_HOTSPOT_CLICK, [data]);
        }, this));
        $hotspots[ix] = { hotspot: $hotspot, data: data, handle: $handle };
        this.lon += 0.01;
    }
function create_hotspot ( data ) { var geometry = data . geometry || 'dot' , type = data . type || 'nav' , ix = $hotspots . length , $hotspot = div ( { class : 'leanorama-hotspot leanorama-hotspot-' + geometry , id : data . id } ) , $handle = div ( { class : 'leanorama-hotspot-handle' } ) , $handle_inner = div ( { class : 'leanorama-hotspot-handle-' + type , id : data . id + '_handle' } ) ; var title ; switch ( type ) { case 'nav' : title = data . name || 'Go to' ; $handle_inner . attr ( 'rel' , 'tooltip' ) . attr ( 'data-html' , true ) . attr ( 'data-original-title' , title ) ; break ; case 'info' : var closebtn = '<span class="btn btn-mini btn-danger" style="float: right;" onclick="$(\'#' + data . id + '_handle\').popover(\'hide\');">x</span>' ; title = '<b>' + ( data . name || 'Information' ) + '</b>' + closebtn ; var content = data . value || data . name || 'N/A' ; $handle_inner . attr ( 'rel' , 'popover' ) . attr ( 'data-html' , true ) . attr ( 'data-original-title' , title ) . attr ( 'data-content' , content ) ; break ; case 'link' : title = data . name || 'Link' ; $handle_inner . attr ( 'rel' , 'tooltip' ) . attr ( 'data-html' , true ) . attr ( 'data-original-title' , title ) . click ( function ( ) { window . open ( data . value , '_blank' ) ; } ) ; break ; case 'action' : title = data . name || 'Turn On/Off' ; $handle_inner . attr ( 'rel' , 'tooltip' ) . attr ( 'trigger' , 'manual' ) . attr ( 'data-placement' , 'bottom' ) . attr ( 'data-html' , true ) . attr ( 'data-original-title' , title ) ; break ; } this . $sides [ data . face ] . append ( $hotspot ) ; $hotspot . css ( { top : data . y , left : data . x } ) ; this . $el . append ( $handle . append ( $handle_inner ) ) ; $ ( '.leanorama-hotspot-handle-info' ) . popover ( ) ; $ ( '.leanorama-hotspot-handle-nav' ) . tooltip ( ) ; $ ( '.leanorama-hotspot-handle-link' ) . tooltip ( ) ; $handle . bind ( 'touchend click' , $ . proxy ( function ( ) { this . $el . trigger ( this . EV_HOTSPOT_CLICK , [ data ] ) ; } , this ) ) ; $hotspots [ ix ] = { hotspot : $hotspot , data : data , handle : $handle } ; this . lon += 0.01 ; }
Create a hotspot on panorama's surface
Create a hotspot on panorama ' s surface
// Hotspot's geometry and type - corresponds with the model // The index for the hotspot inside the hotspot array // Create the hotspot and the handle // Handle the navigational hotspots // Handle the informational hotspots // Handle the link hotspots // Handle the actionable hotspots // Append the hotspot to the face it belongs, and place it where it should be // Construct hotspot layer on the panorama // Init the relevant Bootstrap objects for the hotspots // TODO: For touch event - check that on touchend the finger is still //       on the hotspot, otherwise don't trigger the event. // Add hotspot to the hotspot array // Fugly fugly hack hack hack!!!