AE位置查询时,在遍历图层数量加载时,报“未将对象引用设置到对象的实例。”的错,可以看一下图片

  private void FrmSpatialQuery_Load(object sender, EventArgs e)
        {
            ILayer pLayer = null;
            //添加图层到ckListBoxLayer
            for (int i = 0;i<frmMap.axMapControl1.LayerCount; i++)
            {
                //加载图层
                pLayer = frmMap.axMapControl1.get_Layer(i);
                if (pLayer is FeatureLayer)
                {
                    ckListBoxLayer.Items.Add(pLayer.Name);
                    cbBoxSoureLayer.Items.Add(pLayer.Name);
                }
            }
            cboxRelationShip.Items.Add("Within");
            cboxRelationShip.Items.Add("Intersect");
            cboxRelationShip.Items.Add("Container");
        }
(_JQTV5~5)@PKFWOZFEU`G.png
已邀请:

朱新颖

赞同来自:

axMapControl1里的Map是不是null啊?

MENTHA

赞同来自:

你好 我也出现了这个问题 可以问下是怎么解决的么?虽然已经时隔很久了...

要回复问题请先登录注册