mapx 中如果一次性的删除图层上的所有图元?

szwwhui 2006-10-16 10:46:53
mapx 中如果一次性的删除图层上的所有图元?
...全文
633 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
islkeng 2006-12-15
  • 打赏
  • 举报
回复
Dim fls As Object
Dim filePath As String
Set fls = CreateObject("Scripting.FileSystemObject")

frmMainMap.Map1.Layers.Remove LayerName

filePath = App.Path + "\" + gDynamicLyrPath
If fls.FileExists(filePath + "\" + LayerName + ".tab") Then
Kill filePath + "\" + LayerName + ".tab"
Kill filePath + "\" + LayerName + ".dat"
Kill filePath + "\" + LayerName + ".map"
Kill filePath + "\" + LayerName + ".id"
Kill filePath + "\" + LayerName + ".ind"
End If

Set objectLayer = frmMainMap.Map1.Layers.CreateLayer(LayerName, filePath + "\" + LayerName + ".tab", position)
Set objectDataSet = frmMainMap.Map1.DataSets.Add(miDataSetLayer, objectLayer)
Set objectLayer.LabelProperties.Dataset = objectDataSet
Set objectLayer.LabelProperties.DataField = objectDataSet.Fields.Item("GEONAME")
objectLayer.LabelProperties.position = miPositionTC
frmMainMap.Map1.Layers.Item(LayerName).AutoLabel = True
charryli 2006-12-13
  • 打赏
  • 举报
回复
to 楼上的
你那种只是把该图层从当前mapx中卸载出去,实际上没有真正的删除。

要真正的删除,还是需要删除feature的
gkhome3976 2006-12-06
  • 打赏
  • 举报
回复
m_ctrlMapX.GetLayers ().Remove (index) ;
index是你图元所在图层的索引值,直接把图层删了,图元也就一次性删了。
zwlwenlong 2006-11-08
  • 打赏
  • 举报
回复
一、就是删除图层,这个可能比较快
二、就是循环删除每个图元了。太多恐怕要删一会了
starrygis 2006-10-30
  • 打赏
  • 举报
回复
顶一下。。。
liangxiliang 2006-10-30
  • 打赏
  • 举报
回复
定义:
i:integer;
ftrs:CMapXFeatures;
代码:
ftrs:=map1.Layers.Item('图层X').AllFeatures;
for i:=1 to ftrs.Count do
map1.Layers.Item('图层X').DeleteFeature(ftrs.Item(i));
letheanwater 2006-10-16
  • 打赏
  • 举报
回复
把层删掉哇!
构建游标,循环删除

检索所有的FEATURE,逐个删除

2,142

社区成员

发帖
与我相关
我的任务
社区描述
它是一种特定的十分重要的空间信息系统。它是在计算机硬、软件系统支持下,对整个或部分地球表层(包括大气层)空间中的有关地理分布数据进行采集、储存、管理、运算、分析、显示和描述的技术系统。
社区管理员
  • 地理信息系统
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧