0
信息窗口無法在地圖上打開視圖調試沒有任何錯誤。Google地圖InfoWindow在鏈接點擊事件時沒有在地圖上打開窗口
但我沒有得到什麼錯誤,我的代碼信息窗口沒有打開。
這裏是我的代碼
columns.Bound(e => e.AssetNumber).Template(@<text></text>).ClientTemplate("<a style=\"cursor: pointer;\" onclick=\"showmapbyassetid('#:AssetId#','#:AssetNumber#');\">#=AssetNumber#</a>").Title("Asset Number");
當我呼籲所有的鏈接showmapbyassetid方法單擊當調試工作正常,但信息窗口沒有打開查看地圖
這裏是我的JavaScript方法
function showmapbyassetid(_assetid, _assetnumber) {
var IsAuthorized = '@AssetTrackingSystem.Utils.Authorize.IsAuthorized((System.Data.DataTable)Session["Priviliges"], new Guid(Session["CurrentCompanyId"].ToString()), 3, 2)';
if (IsAuthorized.toLowerCase() == 'false') {
alert("You are not authorized to view Asset Details");
return false;
}
//debugger;
assetid = _assetid;
if (markerarray != null) {
//debugger;
var cnt = null;
var lat = null, long = null;
var mycenter = null;
var got = false;
$.each(markerarray, function (i, item) {
// //debugger;
if (item.title.toLowerCase() == _assetnumber.toLowerCase()) {
mycenter = new google.maps.LatLng(item.position.B, item.position.k);
$.each(infowindowcontent, function (j, info) {
//debugger;
var iiii = allinfowindows;
if (info.indexOf("AssetId=" + _assetid) != -1) {
cnt = info;
got = true;
}
if (got)
return false;
});
//debugger;
SetDeffColor();
closeAllInfoWindows();
item.setIcon('http://maps.google.com/mapfiles/ms/icons/yellow-dot.png')
var infowindow = new google.maps.InfoWindow({
content: cnt
});
allinfowindows.push(infowindow);
map.setCenter(mycenter);
infowindow.open(map, item);
}
if (got)
return false;
});
}
}