0

I am working on a project, and I have not worked with cartodb long, but there is something wrong with this code. It is supposed to display a little pop window showing the school district for that particular area, but it does not do anything when hovered around or clicked. Can someone look at it and tell me the bug/issue?

Here's a link to see how it is currently rendered (notice that clicking on or hovering over an area on the map doesn't initiate any event, even though this is a defined action).

I posted all my code for better understanding of the overall meaning, but I believe the error most likely resides in the javascript. See all code below and please feel free to ask for any questions, clarifications, etc.

window.onload = function() {
    // Instantiate new map object, place it in 'map' element
    var map_object = new L.Map('map', {
      center: [31.50, -98.41], // Johnson City
      zoom: 6
    });

    // Put layer data into a JS object
    var layerSource = {
      user_name: 'texasappleseed',
      type: 'cartodb',
      sublayers: [{
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #F1EEF6;  polygon-opacity: 0.8;  line-color: #ffffff;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 7] {   polygon-fill: #91003F;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 6] {   polygon-fill: #CE1256;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 5] {   polygon-fill: #E7298A;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 4] {   polygon-fill: #DF65B0;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 3] {   polygon-fill: #C994C7;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 2] {   polygon-fill: #D4B9DA;}#ratiodistrictsignificant_placements_merge [ total_daep_placements_by_pop <= 1] {   polygon-fill: #F1EEF6;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= 685.0] { polygon-fill: #B0182B;}#ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= 25] {polygon-fill: #E37853;} #ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= 10] {polygon-fill: #FECDA5;}#ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= 1.25] {  polygon-fill: #F7F7F7;} #ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= .75] {  polygon-fill: #9BD9E9;}#ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= .25] { polygon-fill: #349ED3;} #ratiodistrictsignificant_placements_merge [ ratio_eco_disadv_daep_placements_vs_average <= .1] { polygon-fill: #2166AC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= 685.0] { polygon-fill: #B0182B;}#ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= 25] {polygon-fill: #E37853;} #ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= 10] {polygon-fill: #FECDA5;}#ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= 1.25] {  polygon-fill: #F7F7F7;} #ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= .75] {  polygon-fill: #9BD9E9;}#ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= .25] { polygon-fill: #349ED3;} #ratiodistrictsignificant_placements_merge [ ratio_spec_ed_daep_placements_vs_average <= .1] { polygon-fill: #2166AC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= 685.0] { polygon-fill: #B0182B;}#ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= 25] {polygon-fill: #E37853;} #ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= 10] {polygon-fill: #FECDA5;}#ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= 1.25] {  polygon-fill: #F7F7F7;} #ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= .75] {  polygon-fill: #9BD9E9;}#ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= .25] { polygon-fill: #349ED3;} #ratiodistrictsignificant_placements_merge [ ratio_black_or_african_american_daep_placements_vs_average <= .1] { polygon-fill: #2166AC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 685.0] { polygon-fill: #0C2C84;}#ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 50] {polygon-fill: #225EA8;} #ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 25] {polygon-fill: #1D91C0;}#ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 10] {  polygon-fill: #41B6C4;} #ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 2] {  polygon-fill: #7FCDBB;}#ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= 1] { polygon-fill: #C7E9B4;} #ratiodistrictsignificant_placements_merge [ ratio_asian_daep_placements_vs_average <= .5] { polygon-fill: #FFFFCC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 685.0] { polygon-fill: #0C2C84;}#ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 50] {polygon-fill: #225EA8;} #ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 25] {polygon-fill: #1D91C0;}#ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 10] {  polygon-fill: #41B6C4;} #ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 2] {  polygon-fill: #7FCDBB;}#ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= 1] { polygon-fill: #C7E9B4;} #ratiodistrictsignificant_placements_merge [ ratio_hispanic_latino_daep_placements_vs_average <= .5] { polygon-fill: #FFFFCC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 685.0] { polygon-fill: #0C2C84;}#ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 50] {polygon-fill: #225EA8;} #ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 25] {polygon-fill: #1D91C0;}#ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 10] {  polygon-fill: #41B6C4;} #ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 2] {  polygon-fill: #7FCDBB;}#ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= 1] { polygon-fill: #C7E9B4;} #ratiodistrictsignificant_placements_merge [ ratio_american_indian_or_alaska_nat_daep_placements_vs_average <= .5] { polygon-fill: #FFFFCC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 685.0] { polygon-fill: #0C2C84;}#ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 50] {polygon-fill: #225EA8;} #ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 25] {polygon-fill: #1D91C0;}#ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 10] {  polygon-fill: #41B6C4;} #ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 2] {  polygon-fill: #7FCDBB;}#ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= 1] { polygon-fill: #C7E9B4;} #ratiodistrictsignificant_placements_merge [ ratio_two_or_more_races_daep_placements_vs_average <= .5] { polygon-fill: #FFFFCC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      },
      {
          sql: "SELECT * FROM ratiodistrictsignificant_placements_merge",
          cartocss: '#ratiodistrictsignificant_placements_merge{polygon-fill: #FFFFCC; polygon-opacity: 0.8; line-color: #FFF;  line-width: 0.5;  line-opacity: 1;}#ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 685.0] { polygon-fill: #0C2C84;}#ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 50] {polygon-fill: #225EA8;} #ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 25] {polygon-fill: #1D91C0;}#ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 10] {  polygon-fill: #41B6C4;} #ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 2] {  polygon-fill: #7FCDBB;}#ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= 1] { polygon-fill: #C7E9B4;} #ratiodistrictsignificant_placements_merge [ ratio_white_daep_placements_vs_average <= .5] { polygon-fill: #FFFFCC;}',
          interactivity: ['cartodb_id','total_daep_placements_by_pop','distname', 'dpetallc']
      }]
    };

    // For storing the sublayers
    var sublayers = [];

      // show the layout for a particular sublayer on the map 
    function createSelector(layer,num) {
      for (var i = 0; i < layer.getSubLayerCount(); i++) {
        if (i === num) {
          layer.getSubLayer(i).show();

        } else {
          layer.getSubLayer(i).hide();
        }
      }
      $(allLegend.render().el).hide();
      $(Legend2.render().el).hide();
      if (num === 0) (
              $(allLegend.render().el).show()
      );
      else(
              $(Legend2.render().el).show()
      )
    };

    // Pull tiles from OpenStreetMap
    L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
      attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">Stamen</a> contributors'
    }).addTo(map_object);
   // create the layer for the map 
   cartodb.createLayer(map_object, layerSource)
            .addTo(map_object)
             // adds the hover interaction to the map 
            .done(function(layer) {
              for (var i = 0; i < layer.getSubLayerCount(); i++) {
                sublayers[i] = layer.getSubLayer(i);

             //set the popup that's been defined in the html file   
             sublayers[i].infowindow.set('template', $('#infowindow_template').html());
                  sublayers[i].setInteraction(true);
                  sublayers[i].setInteractivity('distname,total_daep_placements_by_pop,dpetallc,ratio_eco_disadv_daep_placements_vs_average');

  // when the ith sublayer is click perform the following action           
   sublayers[i].on('featureClick', function(e, latlng, pos, data) {

// displays data for debugging purposes                    
   console.log(data.distname + " Number of Students in District:" + data.dpetallc + " Number of Alternative Placements per 100 Students " + data.total_daep_placements_by_pop + " Ratio of Eco Disadv. Placements to Avg: " + data.ratio_eco_disadv_daep_placements_vs_average);
                  });
              }
              $("li").on('click', function(e) {
                var num = +$(e.target).attr('data');
                $("li").css('background-color', '#FFFFFF');
                $("li").hover(function() {
                  $(this).css("background-color", "#E5E5E5");
                }, function() {
                  $(this).css("background-color", "#FFFFFF");
                });
                $(e.target).css('background-color', '#C1C1C1');
                $(e.target).unbind("mouseenter mouseleave");
                console.log("layer" + num);
                createSelector(layer, num, $(e.target).attr("class"));
              });
              createSelector(layer, 0, "")
              $("li[data='0']").css('background-color', '#C1C1C1');
            })
            .error(function(err) {
              console.log("error: " + err);
            });

    var Legend2 = new cdb.geo.ui.Legend.Density({
      title: "Inequity Level, per district",
      left: "0", right: "over 50", colors: [ "#2166AC", "#349ED3", "#9BD9E9", "#F7F7F7", "#FECDA5", "#E37853", "#B0182B" ]
    });
    $('#map').append(Legend2.render().el);


  // Hide the other legends by default
  $(Legend2.render().el).hide()
    //legend for overall stats which will display on load
    var allLegend = new cdb.geo.ui.Legend.Density({
      title:   "Number of Placements per 100 Students, Per District",
      left: "0", right: "7", colors: [ "#F1EEF6", "#D4B9DA", "#C994C7", "#DF65B0", "#E7298A", "#CE1256", "#91003F"  ]
    });
    $('#map').append(allLegend.render().el);

  }

HTML file

    <!DOCTYPE html>
<html>
  <head>
    <title>Alternative School Placements Placements</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <link rel="shortcut icon" href="https://cartodb.com/assets/favicon.ico" />

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" />
    <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
    <link rel="stylesheet" href="tamaps.css">
  </head>
  <body>
        <div id="masthead">
            <div id="logo">
                <img title="Texas Appleseed" src="https://www.texasappleseed.org/sites/all/themes/zocalo_custom_zen_theme/images/tx-appleseed-header-logo.png" style="max-height: 60px" alt="Texas Appleseed">
            </div>
            <div id="mastright">
            <p class="dash">Alternative School Placements, Pre-K through 12th Grade (2013-14)</p>
      <p>*Inequity Level is calculated as the percentage of referred students divided for that group divided by the percentage of total students in the total population. <i>Higher inequity levels represent greater inequity in the district.</i></p>
            </div>
        </div>
    <div id="viewport">
    <div id="map"></div>
            <div id="cartocss" class="layer_selector">
                 <p id="selector_title">ALTERNATIVE SCHOOL PLACEMENTS</p>
                 <ul class="LayerSelector-list">
                     <li data="0">Overall</li>
                     <li data="1">Economically Disadvantaged Students</li>
                     <li data="2">Special Education Students</li>
                     <li data="3">African American Students</li>
                     <li data="4">Asian Students</li>
                     <li data="5">Hispanic Students</li>
                     <li data="6">Native American Students</li>
                     <li data="7">Students of two or More Races</li>
                     <li data="8">White Students</li>
                 </ul>
            </div>
    </div>

    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
    <script type="text/javascript" src="http://fast.fonts.net/jsapi/b6470a43-5105-49d3-95ae-75217a436bf8.js"></script>

    <!-- include cartodb.js library -->
    <script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
    <script type="infowindow/html" id="infowindow_template">
            <div class="cartodb-popup v2">
                <a href="#close" class="cartodb-popup-close-button close">x</a>
                 <div class="cartodb-popup-content-wrapper">
                     <div class="cartodb-popup-header">
                         <img style="width: 100%" src="https://cartodb.com/assets/logos/logos_full_cartodb_light.png"></src>
                     </div>
                     <div class="cartodb-popup-content">
                         <!-- content.data contains the field info -->
                         <h4>City: </h4>
                         <p>{{content.data.distname}}</p>
                     </div>
                 </div>
                 <div class="cartodb-popup-tip-container"></div>
            </div>
        </script>
    <script src="tamap.js"></script>
  </body>
</html>    

CSS file

    /**
 *  Taken from CartoDB infowindow dark styles
 */
    html, body {
    height: 100%;
    padding: 0;
    margin: 0;
}

#viewport {
    position: relative;
    height: calc(100% - 85px);
    background-color: #f0f0f0;
    overflow: hidden;
    border: 1px solid #999;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0;
    margin: 0;
    width: 100%;
}

#masthead {
    height: 85px;
    margin: 0;
    border-top: 1px solid #CDCDCD;
    padding: 4px 12px 10px 15px;
    background-image: url(https://www.texasappleseed.org/sites/all/themes/zocalo_custom_zen_theme/images/tx-appleseed-header-background-pattern.png);
    background-repeat: repeat;
}
#mastright {
    height: 80px;
    margin-left: 200px;
    font-family: "museo-slab", serif;
}
#logo {
    float: left;
    height: 65px;
    margin-left:20px;
    margin-top:5px;
}
#masthead p {
    font-size: 13px;
    font-weight: 200;
}
.dash {
    text-align: left;
    font-size: 16px;
    font-weight: 300;
}

.legend-title {
    text-align:center ;
}

.layer_selector {
    background: #fff;
    border-radius: 4px;
    padding: 0;
    border: 1px solid #999999;
    width: 240px;
    box-shadow: rgba(0, 0, 0, 0.2) 0 0 4px 2px;
    /*font: 11px 'Helvetica';*/
    position: absolute;
    right: 20px;
    bottom: 140px;
}

.layer_selector > p {
    font-weight: bold;
    color: #000000;
    font-size: 12px;
    padding: 12px 12px 10px 12px;
    margin: 0px;
    cursor: pointer;
    text-align: center;
    border-bottom: 1px solid #999;
}

.layer_selector ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
    bottom: 36px;
    border-radius: 4px;
}
.layer_selector li {
    padding: 10px;
    font-size: 11px;
    text-align: center;
    color: #222;
    cursor: pointer;
}
.layer_selector li:not(:last-child) {
    border-bottom: 1px solid #999;
}
.layer_selector li:hover {
    background-color: #e5e5e5;
    cursor: pointer;
}
.layer_selector li:active,
.layer_selector li.cartocss_selected {
    background-color: #c1c1c1;
}

div.cartodb-legend-stack {
    bottom: 20px;
    right: 30px;
}

#textbox {
    position: absolute;
    top: 100px;
    color: rgba(255, 255, 255, .8);
    text-align: center;
    font: 300 14px/20px 'Helvetica';
    left: 300px;
    right: 300px;
}

.title-inner {
    position: absolute;
    top: 40px;
    right: 60px;
    left: 60px;
    text-align: center;
}
.title {
    position: relative;
    font:900 40px/1 'Merriweather';
    color: #fff;
    z-index: 2;
    letter-spacing: -1px;
    display: inline-block;
}
.title:after {
    content:"";
    position: absolute;
    width: 50px;
    height: 1px;
    background: #fff;
    top: 50%;
    left: -70px;
}
.title:before {
    content:"";
    position: absolute;
    width: 50px;
    height: 1px;
    background: #fff;
    top: 50%;
    right: -70px;
}

.leaflet-left .leaflet-control {
    margin-left: 30px;
    margin-top: 65px;
}

@media (max-width: 1200px) {
    #textbox {
        left: 80px;
        right: 80px;
    }
}

@media (max-width: 800px) {
    .layer_selector {
        right: auto;
        bottom: 30px;
        left: 30px;
    }

    .leaflet-control-container {
        display: none !important;
    }
    .header {
        position: absolute;
        background: #333;
        padding: 25px;
        top: 0;
        right: 0;
        left: 0;
    }
    .title-inner {
        position: static;
    }
    .title {
        font: 900 20px/1 'Merriweather';
        margin-bottom: 10px;
    }
    #textbox {
        position: static;
        font: 400 12px/18px 'Merriweather';
    }
    .layer_selector ul {
        height: 0;
        opacity: 0;
    }
    .layer_selector > p {
        border-bottom: 0;
        background: #999999;
    }
    .layer_selector.is-active > p {
        border-bottom: 0;
        background: #ffffff;
    }

    .layer_selector.is-active ul {
        height: auto;
        opacity: 1;
    }
    .layer_selector.is-active > p {
        border-bottom: 1px solid #999;
    }
}
@media (max-width: 600px) {
    .layer_selector {
        right: 30px;
        bottom: 140px;
        left: auto;
    }
}
1

Check this block where the infowindows are added using a documented method, instead of directly modifying the properties of the layer.

  cartodb.vis.Vis.addInfowindow(
    map, 
    sublayer, 
    ['cartodb_id', 'lat', 'lon', 'name'],
    {
      infowindowTemplate: $('#infowindow_template').html(),
      templateType: 'mustache'
    }
  );

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.