Engine中加载了地图服务图层,如何判断其是否是缓存地图服务?

Engine中加载了地图服务图层,如何判断其是否是缓存地图服务?
已邀请:

朱新颖

赞同来自:

【解决办法】:
1,第一种方法:
连接Server后,获取该服务的IServerObjectConfiguration,其isCached属性,返回值为true即为切片服务,返回值为false即没有切片。

2,第二种方法:
获取到IMapServer后转为ITiledMapServer,然后通过HasSingleFusedMapCache和HasLayerCache判断是否有切片,如果这两个bool值都返回false就是没有切片,如果有一个返回true就是有切片  


IServerObjectAdmin m_ServerObjectAdmin = ConnectAGS(https://xinying.arcgismap.com:6443/arcgis/admin, arcgis, arcgis);
            IServerObjectConfiguration con = m_ServerObjectAdmin.GetConfiguration(SampleWorldCities, MapServer);
            IPropertySet propertySet = con.Properties;
          
            object value = propertySet.GetProperty(isCached);



if(mapserver is ITiledMapServer) 

ITiledMapServer2 tiled = mapserver as ITiledMapServer2; 

bool a = tiled.HasSingleFusedMapCache(mapserver.DefaultMapName); 
bool b = tiled.HasLayerCache(mapserver.DefaultMapName, 0); 
}

要回复问题请先登录注册