I am trying to add a few pushpin with separate info boxes. this means that each button will have its own info box with its own information. there is loop.inside that
latlng = new Microsoft.Maps.Location(latitude[pointerCount], longtitue[pointerCount]); MarkingLocation[pointerCount] = new Microsoft.Maps.Pushpin(latlng, {icon:"marker2.ico", height:50, width:50, anchor:new Microsoft.Maps.Point(0,50)}); myInfobox = new Microsoft.Maps.Infobox(latlng, myinfoboxOption); Microsoft.Maps.Events.addHandler(MarkingLocation[pointerCount], 'click', function() {myInfobox.setOptions({ visible:true });}); map.entities.push(MarkingLocation[pointerCount]); map.entities.push(myInfobox);
The problem is that it shows the latest infobox for each button only. Suppose I have 4 buttons in London, France, Germany, America. Now, no matter what contact I clicked, it shows only the American info box on America pushpin.please, can someone help that I'm missing .........
And one more thing: someone can show a way to use htmlContent in infoboxes. I tried to set its thrugh option, but that doesn’t bother ......
myinfoboxoption = {width:300, height: 100, title: str_loc, htmlContent: htmlc, showPointer: false, offset: new Microsoft.Maps.Point(-100,0)};
Please, help........
source share