Hi mikediaz,
Here you can find how to create mutilple infoBubbles:
http://api.maps.nokia.com/en/mobile/...foBubbles.html
And here is an example how to do this. It also should answer your question about FOR loop.
Make sure you use > 0.2.0 of MH5
Code:
nokia.mh5.assetsPath = "http://api.maps.nokia.com/mobile/0.2.0/lib/";
nokia.mh5.appId = "demo_wwzrmoloHAFVvyW";
nokia.mh5.appCode = "Vgl_08RQWnjJo92Lw1F_uQ";
var map = new nokia.mh5.components.Map({
infoBubble: {
content: ["title"],
listeners: {
click: function() {
//handle the click event on the infoBubble
}
}
},
listeners: {
poiclick: function(e) {
e.preventDefault();//prevents hiding open infoBubbles and opening a new one
var poi = e.data[0];
if (!poi.infoBubble) {
//first check whether the clicked poi isn't a infobubble
this.showInfoBubble(poi);
}
},
mapclick: function(e) {
e.preventDefault();//prevents hiding open infoBubbles
},
maplongpress: function(e) {
e.preventDefault();//prevents hiding open infoBubbles and opening a new one
},
ready: function() {
var pois = [{
longitude: 13.32,
latitude: 52.32,
name: "po1",
categoryIcon: nokia.mh5.assetsPath + "img/categories/12.icon.mh5.basic.png"
}, {
longitude: 13.31,
latitude: 52.31,
name: "po2",
categoryIcon: nokia.mh5.assetsPath + "img/categories/12.icon.mh5.basic.png"
}, {
longitude: 13.30,
latitude: 52.30,
name: "po3",
categoryIcon: nokia.mh5.assetsPath + "img/categories/12.icon.mh5.basic.png"
}];
this.pois = pois;
//make sure the user sees all pois
this.box = pois;
}
}
});
document.body.appendChild(map.root);
Br,
Leo