以下是显示此错误的代码。 任何帮助赞赏 提前致谢。
private void BuildMap(string itineraryCode)
{
bool IsMapPresent = false;
if (!string.IsNullOrEmpty(Session[SessionConstants.LanguageCode].ReturnString()))
{
string languageCode = Session[SessionConstants.LanguageCode].ReturnString();
CityCollection cityCollection = CityBLL.GetCityMapForItinerary(itineraryCode, languageCode);
GMarker[] marker;
GListener[] listner;
try
{
if (cityCollection != null && cityCollection.Count > 0)
{
//for modal header
H3Header.InnerText = cityCollection[0].CountryName;
marker = new GMarker[cityCollection.Count];
listner = new GListener[cityCollection.Count];
int count = 0;
GCustomCursor customCursor = new GCustomCursor(cursor.pointer, cursor.auto);
gmapQuoVadis.addCustomCursor(customCursor);
foreach (CityBLL cityBLL in cityCollection)
{
if (cityBLL.GmapLatitude != 0.0 && cityBLL.GmapLongitude != 0.0)
{
GIcon icon = new GIcon();
icon.image = hostURL + "/custom_images/gmapicon0.png";
GLatLng latlng = new GLatLng(cityBLL.GmapLatitude, cityBLL.GmapLongitude);
gmapQuoVadis.setCenter(latlng);
gmapQuoVadis.Add(new GControl(GControl.preBuilt.MenuMapTypeControl));
gmapQuoVadis.Add(new GControl(GControl.preBuilt.LargeMapControl));
if (cityBLL.GmapZoomLevel != 0 && cityBLL.GmapZoomLevel > 0)
{
gmapQuoVadis.GZoom = cityBLL.GmapZoomLevel;
}
else
{
int number;
bool result = Int32.TryParse(WebAppSettingKeys.GetAppKeyValue(WebAppSettingKeys.ZoomLevelForMap), out number);
gmapQuoVadis.GZoom = number;
}
marker[count] = new GMarker(latlng, icon);
listner[count] = new GListener(marker[count].ID, GListener.Event.click, "showLargeMap");
gmapQuoVadis.addGMarker(marker[count]);
gmapQuoVadis.addListener(listner[count]);
IsMapPresent = true;
}
}
if (IsMapPresent == false)
{
divMap.Visible = false;
divMapNotFound.Visible = true;
divMapNotFound.InnerHtml = "<img style='height:219px;width:255px;' src="+hostURL+"custom_images/noimg.jpg"+" />";
}
else
divMap.Visible = true;
}
}
finally
{
cityCollection = null;
gmapQuoVadis = null;
marker = null;
listner = null;
}
}
else
{
Response.Redirect(hostURL + Common.PageName.SESSION_EXPIRED);
}
}