destnity
路人甲
路人甲
  • 注册日期2004-03-25
  • 发帖数341
  • QQ
  • 铜币272枚
  • 威望0点
  • 贡献值0点
  • 银元0个
10楼#
发布于:2004-08-16 15:16
下面的代码可以参考一下。
The following example is a code excerpt that shows how to change the fine-grained ArcObjects (by adding a new group layer), and apply these changes to the MapServer object using RefreshServerObjects.
It assumes that you are developing an ArcGIS Server application using a ServerContext, and already have a valid ServerContext, MapServer and MapDescription object.

Dim pServerContext as IServerContext
Dim pMapServer as IMapServer
Dim pMapDesc as IMapDescription
'Access fine-grained ArcObjects
Dim pMapServerObj As IMapServerObjects
Set pMapServerObj = pMapServer
Dim strMapName as string
strMapName = pMapServer.DefaultMapName
Dim pMap As IMap
Set pMap = pMapServerObj.Map(strMapName)
    
'Add new group layer to map
Dim pGroupLayer As IGrouplayer
Set pGroupLayer = pServerContext.CreateObject("esriCarto.GroupLayer")
pGroupLayer.Name = "New Group Layer"
pMap.AddLayer pGroupLayer
    
'Apply changes to MapServer object
pMapServerObj.RefreshServerObjects
    
'Get updated MapServerInfo and MapDescription
Dim pMapServerInfo as IMapServerInfo
Set pMapServerInfo = pMapServer.GetServerInfo(strMapName)
Set pMapDesc = pMapServerInfo.DefaultMapDescription
[此贴子已经被作者于2004-8-16 15:21:00编辑过]
签 名: 不能超过 250 个字符 文字将出现在您发表的文章的结尾处。
举报 回复(0) 喜欢(0)     评分
wangcheng
路人甲
路人甲
  • 注册日期2004-06-06
  • 发帖数141
  • QQ39308652
  • 铜币110枚
  • 威望0点
  • 贡献值0点
  • 银元0个
11楼#
发布于:2004-08-14 20:22
<P>请大家支持一下。。。给顶下啊。。说点自己的看法也行啊。。。</P><P>我看了半天IGROUPLAYER接口就是不明白怎么做。。请大吓帮忙看看。该怎么用?</P><img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
上一页 下一页
游客

返回顶部