如何访问 arcobjects 中底图的子图层?
ILayer layer = mapControl.get_Layer(1); //layer 1 is usa_base_map
我有一个 ILayer,现在我想访问并打开和关闭各种子层,例如街道层或铁路层。你能告诉我如何访问这些层吗?
ILayer layer = mapControl.get_Layer(1); //layer 1 is usa_base_map
I have an ILayer, now I want to access and turn on and off various sublayers like the street layer or the railroad layer. Can you tell me how to access these layers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您需要将图层组投射到
ICompositeLayer
(链接)。I think you'll want to cast your group layer to an
ICompositeLayer
(linky).访问底图子图层
以下代码示例演示如何访问底图子图层、检索内层、更新内层的属性以及向底图图层通知更改。该通知会使图层的内部缓存失效,以便重新绘制内容以反映更新。在此示例中,更新清除了要素图层的定义表达式。
[C#]
[VB.NET]
Accessing a basemap sublayer
The following code example shows how to access a basemap sublayer, retrieve the inner layer, update a property on the inner layer, and notify the basemap layer of the change. The notification invalidates the layer's internal cache so that the content is redrawn to reflect the update. In this example, the update clears the definition expression of a feature layer.
[C#]
[VB.NET]