Hi there,
to get a map with markers in a container and have infobubbles do this:
Code:
var infoBubbles = new nokia.maps.map.component.InfoBubbles(),
map = new nokia.maps.map.Display(myMapContainerDiv, {
components: [infoBubbles]
}),
markerContainer = new nokia.maps.map.Container(),
i = 100;
//add event listener on the marker to open the bubble
markerContainer.addListener("click", function(evt) {
var marker = evt.target;
infoBubbles.addBubble(marker.$infoBubbleText, marker.coordinate);
});
//add 100 markers (may be sensible to use different coordinates than always the map's center)
while(i--) {
markerContainer.objects.add(new nokia.maps.map.StandardMarker(map.center, {
//custom property prefixed with $ to avoid overwriting StandardMarker properties
$infoBubbleText: "This is marker " + i
}));
}
//finally add the container to the map
map.objects.add(markerContainer);
To remove you can do the following:
Code:
markerContainer.objects.clear();
while(infoBubbles.openBubbleHandles.getLength() > 0) {
infoBubbles.removeBubble(infoBubbles.openBubbleHandles.get(0));
}