以下是我添加信息气泡的代码。我想在单击(轻按)其他标记后删除先前的信息气泡。
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);
}
如果我点击不同的标记,应在何处放置代码行ui.removeBubble(bubble)
?