Bing! Map How to create an info box popup

James Radford picture James Radford · May 26, 2011 · Viewed 10.1k times · Source

I have a pin on my Bing! version 7 map although I'm failing to find out how to create an onclick event to display an info box !

Can anyone point me in the right direction or provide an example?

I have the following code so far! I need the popup to overlay the map panel.

Many thanks as always!

      var map = null;

      function GetMap() {
            map = new Microsoft.Maps.Map(document.getElementById('myMap'), { credentials: 'xxx' });
            map.entities.clear();

            var pushpinOptions = { icon: 'icon.png', width: 53, height: 61 };
            var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), pushpinOptions);

            var infoboxOptions = {title:'Infobox Title', description:'Infobox description'}; 

            var defaultInfobox = new Microsoft.Maps.Infobox(map.getCenter(), infoboxOptions );    
            map.entities.push(defaultInfobox);
            map.entities.push(pushpin);
        }

Answer

VVPG picture VVPG · Jul 15, 2011