Skip to content

Instantly share code, notes, and snippets.

@Xatpy
Last active August 29, 2015 14:14
Show Gist options
  • Save Xatpy/1d681598113c8e756d27 to your computer and use it in GitHub Desktop.
Save Xatpy/1d681598113c8e756d27 to your computer and use it in GitHub Desktop.
Testing bug_ie_layerInteraction
<!DOCTYPE html>
<html>
<head>
<title>Bug IE | CartoDB.js</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="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
}
</style>
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.12/themes/css/cartodb.css" />
</head>
<body>
<p id='testLabel' style='text-align: center'>EY</p>
<div id="map"></div>
<script type="text/javascript" src="http://www.maps.google.com/maps/api/js?sensor=false&v=3.12"></script>
<!-- include cartodb.js library -->
<script src="http://libs.cartocdn.com/cartodb.js/v3/3.12/cartodb.js"></script>
<script>
function main() {
var map = new L.Map('map', {
center: [43, -62],
zoom: 5
});
L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'Stamen'
}).addTo(map);
L.marker([43,-68], {draggable: true}).addTo(map);
var layerUrl = 'http://documentation.cartodb.com/api/v2/viz/836e37ca-085a-11e4-8834-0edbca4b5057/viz.json';
cartodb.createLayer(map, layerUrl).addTo(map).on('done', function(layer) {
//cartodb.vis.Vis.addCursorInteraction(map, layer);
layer.setInteraction(true);
layer.on('featureOut', function(e, pos, latlng, data) {
debugger
cartodb.log.log('out');
$("#testLabel").text('-OUT-');
});
layer.on('featureOver', function(e, pos, latlng, data) {
cartodb.log.log('over');
$("#testLabel").text('# IN #');
});
})
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment