我有一個Office 365 SharePoint網站,我嘗試使用Bing Maps ajax控件(http://msdn.microsoft.com/en-us/library/gg427610.aspx)顯示包含地理位置數據的列表中的數據。我的地圖正確加載並顯示正確的位置,但實際的圖釘不顯示。我試過默認和自定義圖釘圖標無濟於事。當我在'vanilla'html頁面上使用類似的JavaScript時,圖釘顯示得很好,所以我認爲必須與SharePoint JavaScript或css發生某種衝突。Bing Map圖釘不顯示在Office365 SharePoint頁面上
這裏的碼相關的塊:
function fillListData(web, list, items) {
var tile = $("#" + tileId);
var content = tile.find('.tileContent');
var mapOptions = {
credentials: "",
mapTypeId: Microsoft.Maps.MapTypeId.auto,
showDashboard: false
};
var map = new Microsoft.Maps.Map(content[0], mapOptions);
var locs = [];
var e = items.getEnumerator();
while (e.moveNext()) {
var listItem = e.get_current();
var title = listItem.get_item("Title");
var loc = listItem.get_item("Location");
var lat = loc.get_latitude();
var lon = loc.get_longitude();
var mapLoc = new Microsoft.Maps.Location(lat, lon);
locs.push(mapLoc);
//var pin = new Microsoft.Maps.Pushpin(mapLoc, {text: title, visible: true, icon:'../Style Library/Images/flag_red.png'});
//var pin = new Microsoft.Maps.Pushpin(mapLoc, {visible: true, icon:'../Style Library/Images/flag_red.png', width: 50, height: 50});
var pin = new Microsoft.Maps.Pushpin(mapLoc);
map.entities.push(pin);
}
var bestView = Microsoft.Maps.LocationRect.fromLocations(locs);
map.setView({bounds:bestView });
}
任何見解讚賞。 謝謝。