Public Sub ReDraw_Car(byval objMap As Map)
Dim FoundObj As MapXLib.Feature
Dim FoundObj1 As MapXLib.Feature
Dim Layer As Layer
Dim fs As MapXLib.Features
Dim i As Integer
On Error GoTo LabErr
Set Layer = objMap.Layers(MapTempLayer1)
Set fs = Layer.AllFeatures
For i = 1 To fs.count
Set FoundObj = fs.Item(i)
If FoundObj.Type = miFeatureTypeText Then
FoundObj.Style = CarTextStyle
Set FoundObj1 = FindObj_InMap(MapTempLayer1, FoundObj.Caption, objmap)
If Not (FoundObj1 Is Nothing) Then
Set FoundObj.Point = FoundObj1.Point
FoundObj.Update
End If
End If
Next
Set FoundObj = Nothing
Exit Sub
LabErr:
Exit Sub
End Sub
'在指定图层查找指定对象
Public Function FindObj_InMap(LayerName As String, objname As String, objMap As Map) As MapXLib.Feature
Dim Layer As MapXLib.Layer
Dim fid As Integer
On Error GoTo LabErr
' fid = 0
Set Layer = objMap.Layers(LayerName)
fid = Layer.FeatureIDFromFeatureName(objname)
Set FindObj_InMap = Layer.GetFeatureByID(fid)
Exit Function
LabErr:
Set FindObj_InMap = Nothing
Exit Function
End Function