dazzle
路人甲
路人甲
  • 注册日期2007-04-27
  • 发帖数3
  • QQ
  • 铜币116枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1442回复:1

关于arcengine加载注记图层的问题

楼主#
更多 发布于:2007-09-08 20:15
<DIV>我把注记图层单独转换出来,放在geodatabase里面,请问如何将它加载到mapcontrol控件里面,谢谢:)<BR>这是现在的代码,可是还是没有加载成功,那位可以提供更加详细的代码,不胜感激。<BR>Dim layerclass As IAnnotationLayerFactory<BR>        Dim layer As IGeoFeatureLayer<BR>        layerclass = Workspace.OpenFeatureClass("jcdl_shxzqhAnno")<BR>        layer = New FeatureLayer<BR>        layer.FeatureClass = layerclass<BR>        layer.Name = "上海市行政区划注记层"<BR>        axMapControl1.Map.AddLayer(layer)<BR>        axMapControl1.ActiveView.Refresh()</DIV>
喜欢0 评分0
gzstyxb
路人甲
路人甲
  • 注册日期2004-09-22
  • 发帖数358
  • QQ
  • 铜币1045枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-09-09 17:04
<P>注记图层的打开,不是这样收拾的。帮助里面有说怎么打开注记的。</P>
<P>顺便看我写的吧,能顺利打开注记图层的。</P>

<P>IFeatureClassPtr ipFClass;<BR> HRESULT result = ipFeatureWorkspace->OpenFeatureClass(<BR>  CComBSTR(layer.strSdeLayer), ;ipFClass);<BR> if (FAILED(result) || NULL == ipFClass) {<BR>  TRACE("\n缺少图层表:%s", layer.strSdeLayer);<BR>  return FALSE;<BR> }</P>
<P> esriFeatureType ftype;<BR> result = ipFClass->get_FeatureType(;ftype);<BR> if (FAILED(result)) {<BR>  AfxMessageBox("查询SDE图层类型出现错误。");<BR>  return FALSE;<BR> }</P>
<P> <BR> ASSERT(NULL != ipGLayer);<BR> if (esriFTAnnotation == ftype) {<BR>  ILayerPtr ipLayer;<BR>  IFeatureDatasetPtr d;<BR>  ipFClass->get_FeatureDataset(;d);   <BR>  IFDOGraphicsLayerFactoryPtr pGLF(CLSID_FDOGraphicsLayerFactory);<BR>  pGLF->OpenGraphicsLayer(ipFeatureWorkspace, d, CComBSTR(layer.strSdeLayer), ;ipLayer);<BR>  ipLayer->put_Name(CComBSTR(layer.strName));<BR>  IAnnotationLayerPtr ipALayer = ipLayer;<BR>  ipGLayer->Add((ILayerPtr)ipLayer);<BR> }</P>
由爱故生忧, 由爱故生怖. 若离于爱者, 无忧亦无怖.
举报 回复(0) 喜欢(0)     评分
游客

返回顶部