Here below is my code to add an infobubble. I want to remove the current infobubble previously after click(tap) on a different marker.
function addInfoBubble(map)
{
var group = new H.map.Group();
map.addObject(group);
// add 'tap' event listener, that opens info bubble, to the group
group.addEventListener('tap', function(evt) {
// event target is the marker itself, group is a parent event target
// for all objects that it contains
var bubble = new H.ui.InfoBubble(evt.target.getPosition(), {
// read custom data
content: evt.target.getData()
});
// show info bubble
ui.addBubble(bubble);
}, false);
}
Where should I place the code line ui.removeBubble(bubble)
if I click on a different marker?