白白侠:Mapx中如何删除图元??
来源:百度文库 编辑:高考问答 时间:2024/05/13 18:36:41
我在VB中使用如下代码,可以在地图上显示5个点:
Dim ggLayer As MapXLib.Layer
Dim ggStyle As MapXLib.Style
Dim gg As MapXLib.Feature
Set ggLayer = Map1.Layers.CreateLayer("ggLayer", , 1)
Set Map1.Layers.AnimationLayer = ggLayer
Set ggStyle = Map1.Layers(1).Style
With ggStyle
.SymbolFont.Name = "mapinfo transportation"
.SymbolCharacter = 97
.SymbolFont.Size = 25
.SymbolFontColor = miColorBlue
End With
Dim f As MapXLib.Feature
Dim p As New MapXLib.Point
Dim x, y As Double
x = 104.123
y = 28.211
For i = 1 To 5
p.Set x, y
Set gg = Map1.FeatureFactory.CreateSymbol(p, ggStyle)
Set f = Map1.Layers("ggLayer").AddFeature(gg)
x = x + 0.09
y = y + 0.05
Next
我想知道怎样把第三个点删掉??谢谢!!
Dim ggLayer As MapXLib.Layer
Dim ggStyle As MapXLib.Style
Dim gg As MapXLib.Feature
Set ggLayer = Map1.Layers.CreateLayer("ggLayer", , 1)
Set Map1.Layers.AnimationLayer = ggLayer
Set ggStyle = Map1.Layers(1).Style
With ggStyle
.SymbolFont.Name = "mapinfo transportation"
.SymbolCharacter = 97
.SymbolFont.Size = 25
.SymbolFontColor = miColorBlue
End With
Dim f As MapXLib.Feature
Dim p As New MapXLib.Point
Dim x, y As Double
x = 104.123
y = 28.211
For i = 1 To 5
p.Set x, y
Set gg = Map1.FeatureFactory.CreateSymbol(p, ggStyle)
Set f = Map1.Layers("ggLayer").AddFeature(gg)
x = x + 0.09
y = y + 0.05
Next
我想知道怎样把第三个点删掉??谢谢!!
Map.Layer(Item).DeleteFeature(FeatureKey / FeatureID)
你不用这么麻烦!在“库”文件中!就可以删除!
什么东西来的,教教我