我需要为地图中的不同场合放置无限数量的infobubbles。然而,每当我把第二个,有一个错误如何在这里创建多个infobubble地图
IllegalArgument: Component instance with ID "InfoBubbles" already registered
显然,问题是我需要分配每一个不同的ID(我觉得默认的ID是“InfoBubbles”),但我无法弄清楚怎么做。
var infoBubble1 = new nokia.maps.map.component.InfoBubbles();
var infoBubble2 = new nokia.maps.map.component.InfoBubbles();
map.components.add(infoBubble1);
map.components.add(infoBubble2); --> Error
我试过;
infoBubble1 .set("id", "xxx");
var infoBubble1 = new nokia.maps.map.component.InfoBubbles({id = "xxx"}); -> not valid since infobubbles only have an empty constructor.
我使用的版本是2.5.4。
很好的答案,但是如果你有1页2地图?同样的错误,因为信息都附加到两个地图上。任何方式绕过这个? – gulty 2014-11-13 13:37:59
我做了你的建议,但它仍然无法正常工作。 当我打开第二个泡泡时,首先消失。 – Zarko 2015-03-21 15:59:47