kml.on("load", function(lyr){ var layers = lyr.layer.getLayers(); array.forEach(layers, function(l) { l.on("click", centerMap); l.setInfoTemplate(null); }); });