【发布时间】:2013-11-21 18:12:15
【问题描述】:
我有一个 Office 365 SharePoint 网站,我尝试使用 Bing 地图 ajax 控件 (http://msdn.microsoft.com/en-us/library/gg427610.aspx) 显示包含地理位置数据的列表中的数据。我的地图加载正确并显示正确的位置,但实际图钉未显示。我试过默认和自定义图钉图标无济于事。当我在“香草”html 页面上使用类似的 JavaScript 时,图钉显示得很好,所以我认为与 SharePoint JavaScript 或 css 一定存在某种冲突。
这里是相关的代码块:
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 });
}
感谢任何见解。 谢谢。
【问题讨论】:
标签: javascript sharepoint-2013 bing-maps