Created
January 8, 2016 19:25
-
-
Save michellechandra/0890a67f513f3fe674db to your computer and use it in GitHub Desktop.
Video Infowindow - Large
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="stylesheet" href="http://libs.cartodb.com/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
<style> | |
html, body, #map { | |
height: 100%; | |
padding: 0; | |
margin: 0; | |
} | |
div.cartodb-popup.v2 { | |
width: 430px !important; | |
height: 325px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
</body> | |
<script type="infowindow/html" id="infowindow_template"> | |
<div class="cartodb-popup v2 dark"> | |
<a href="#close" class="cartodb-popup-close-button close">x</a> | |
<div class="cartodb-popup-content-wrapper"> | |
<div class="cartodb-popup-header"> | |
<iframe width="400" height="280" src="{{content.data.youtube_url}}" frameborder="0" allowfullscreen></iframe> | |
<div class="cartodb-popup-content"> | |
<h4>{{content.data.name}}</h4> | |
</div> | |
</div> | |
<div class="cartodb-popup-tip-container"></div> | |
</div> | |
</script> | |
<script src="http://libs.cartodb.com/cartodb.js/v3/3.15/cartodb.js"></script> | |
<script async src="http://platform.twitter.com/widgets.js" charset="utf-8"></script> | |
<script> | |
function main() { | |
cartodb.createVis('map', 'https://team.cartodb.com/u/chandra/api/v2/viz/fd5891d6-7db4-11e5-84fe-0e31c9be1b51/viz.json', { description: true, search: true, shareable: true }) | |
.on('done', function(vis,layers) { | |
var layer = layers[1].getSubLayer(0); | |
layer.infowindow.set('template', $('#infowindow_template').html()); | |
layer.infowindow.set('sanitizeTemplate', 'false'); | |
layer.on('error', function(err) { | |
console.log('error: ' + err); | |
}); | |
}).on('error', function() { | |
console.log("some error has occurred"); | |
}); | |
} | |
window.onload = main; | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment