如标题“我用GMaps.dll做飞机监控,可为什么本地跑却没问题,一经发布,凡是有访问数据库连接的操作, 地图上就不能显示任何标记”,各位大虾帮忙解决一下,重赏,如果能帮解决,本人请吃海口所有小吃。
我发段代码供各位研究一下:
示例一:
本地运行能正常显示图片,一经发布就不能显示了,淡疼。
     GMap1.enableDragging = true;
        //GMap1.enableGoogleBar = false;
        
        GMap1.Language = "es";
        GMap1.BackColor = Color.White;
        GMap1.setCenter(new GLatLng(20.030793, 110.32885899999996), 5);
        GMap1.Key = ConfigurationManager.AppSettings["GoogleAPIKey"];
        DataSet dsPlanes = data.GetMonitorPlans("", "");
        if (dsPlanes != null && dsPlanes.Tables[0].Rows.Count > 0)
        {

            GLatLng GP = new GLatLng(20.030793, 110.32885899999996);            GIcon icon = new GIcon();
            icon.image = "airplaneicons/blue20.png";            GMarkerOptions mOpts = new GMarkerOptions();
            mOpts.clickable = true;
            mOpts.icon = icon;
            GMarker er = new GMarker();
            er.point = GP;
            er.options = mOpts;
            GMap1.Add(er);
        }
示例二:
如果不加上以上的数据库访问判断,只是这样写,不管发布还是本地都能正常显示,又淡疼一下。
 GMap1.enableDragging = true;
        //GMap1.enableGoogleBar = false;
        
        GMap1.Language = "es";
        GMap1.BackColor = Color.White;
        GMap1.setCenter(new GLatLng(20.030793, 110.32885899999996), 5);
        GMap1.Key = ConfigurationManager.AppSettings["GoogleAPIKey"];
            GLatLng GP = new GLatLng(20.030793, 110.32885899999996);            GIcon icon = new GIcon();
            icon.image = "airplaneicons/blue20.png";            GMarkerOptions mOpts = new GMarkerOptions();
            mOpts.clickable = true;
            mOpts.icon = icon;
            GMarker er = new GMarker();
            er.point = GP;
            er.options = mOpts;
            GMap1.Add(er);
        
GMAP