最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Bing! Map How to create an info box popup - Stack Overflow

programmeradmin4浏览0评论

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);
        }

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);
        }
Share Improve this question edited Dec 8, 2013 at 16:14 Kara 6,22616 gold badges53 silver badges58 bronze badges asked May 26, 2011 at 16:37 James RadfordJames Radford 4234 gold badges7 silver badges13 bronze badges 3
  • how are you creating the elements? it might be easier if you use a georss feed (I do this to create lots of them on my map) ... also, check with the GIS.SE folks – jcolebrand Commented May 26, 2011 at 16:38
  • what are these drachenstern!?? – James Radford Commented May 27, 2011 at 15:34
  • If the problem is about how to use the bing SDK, you might get more answers here: gis.stackexchange. – jcolebrand Commented May 27, 2011 at 15:35
Add a ment  | 

2 Answers 2

Reset to default 2

Here's an example from MSDN http://msdn.microsoft./en-us/library/gg508987.aspx

This page on the Bing sdk site has plenty of example with the code samples below the map:

http://www.bingmapsportal./isdk/ajaxv7

发布评论

评论列表(0)

  1. 暂无评论