2017-03-24 76 views

回答

1

使用HTML和一個img標籤,然後將其作爲信息框的描述值傳入。這裏是一個簡單的代碼示例:

var map = new Microsoft.Maps.Map(document.getElementById('myMap'), { 
    credentials: 'Your Bing Maps Key', 
    center: new Microsoft.Maps.Location(47.60357, -122.32945) 
}); 
var center = map.getCenter(); 
var infobox = new Microsoft.Maps.Infobox(center, { title: 'Map Center', 
    description: 'Here is my image: <img src="https://www.bingmapsportal.com/Content/images/poi_custom.png" />' }); 
infobox.setMap(map); 
+0

是的,我發現我可以添加html到描述框。只花了一段時間的信息框的大小,因爲高度/寬度不起作用,但maxWidth/maxHeight工作。 – chobo2