宾!地图如何创建信息框弹出窗口
我的 Bing 上有一个图钉!版本 7 地图,尽管我无法找到如何创建 onclick 事件来显示信息框!
谁能指出我正确的方向或提供一个例子?
到目前为止我有以下代码!我需要弹出窗口来覆盖地图面板。
一如既往地非常感谢!
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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是来自 MSDN 的示例
http://msdn.microsoft.com/en-us/library/gg508987.aspx
Here's an example from MSDN
http://msdn.microsoft.com/en-us/library/gg508987.aspx
Bing sdk 站点上的此页面有大量示例,其中代码示例位于地图下方:
http://www.bingmapsportal.com/isdk/ajaxv7 bingmapsportal.com/isdk/ajaxv7
This page on the Bing sdk site has plenty of example with the code samples below the map:
http://www.bingmapsportal.com/isdk/ajaxv7