I'm using CartoJS to put one of my CartoDB maps on a div
in an HTML file. When a user mouses over a dot on the map, info appears in the div
next to the map container div
.
I want to change this so the info appears when a user clicks (or taps) a point.
Here is a snippet of my JS code for making the CARTO layer.
cartodb.createLayer(map, layerURL, {infowindow: false, tooltip: false})
.addTo(map)
.done(function(layer){
var infoBox= layer.leafletMap.viz.addOverlay({
type: "infobox",
layer: layer,
template: infoBoxTemplate,
position: "top|right"
});
// Add infoBox to map object
$("#infobox-wrapper").append(infoBox.render().el);
});
How do I change this so info appears in #infobox-wrapper
on click instead of on hover?