Please, help me anyone!!!
I've tried to do something with MapX problem - it crashes when modifying a lot of
data. Now I feel lost - I've tested MapX on just a simple test and it falls down. When
I run my code on small data, it's ok, when i run my code on bigger portion of data,
for the first time it runs ok, for the second time (not closing application) it falls.
May be someone could help me.... Here's the code, there's no way to simplify more:
Dim lrName As String
Private Sub Command1_Click()
Dim LrInfo As New MapXLib.LayerInfo
Dim currlayer, Crossingslayer As MapXLib.Layer
Dim res As Integer
Dim PathSTr, FileSTr As String
If MsgBox("open big data?", vbYesNo) = vbYes Then
PathSTr = "d:\temp\bigdata.tab"
Else
PathSTr = "d:\temp\smalldata.tab"
End If
umapx.Layers.RemoveAll
Set currlayer = umapx.Layers.Add(PathSTr, 1)
lrName = currlayer.Name
umapx.Bounds = currlayer.ClippedBounds
umapx.DataSets.Add miDataSetLayer, currlayer, lrName
umapx.NumericCoordSys = currlayer.CoordSys
' umapx.DisplayCoordSys = currlayer.CoordSys
End Sub
Private Sub Command3_Click()
Dim currlayer As MapXLib.Layer
Set currlayer = umapx.object.Layers.Item(lrName)
Dim iCOunt As Long
Dim ftr As MapXLib.Feature
Dim addftr As New MapXLib.Feature
Dim allftrs As MapXLib.Features
Dim RVals As MapXLib.RowValues
Dim pt As New MapXLib.Point
Dim parts As MapXLib.parts
Dim points As MapXLib.points
Dim pts As New MapXLib.points
currlayer.Pack miPackAll
currlayer.BeginAccess miAccessReadWrite
umapx.AutoRedraw = False
Set allftrs = currlayer.AllFeatures()
For iCOunt = 1 To allftrs.Count
Set ftr = allftrs(iCOunt)
If ftr.Type <> miFeatureTypeLine Then
GoTo m1
End If
Set parts = ftr.parts
For i = 1 To parts.Count
Set points = parts(i)
For j = 2 To points.Count
pts.RemoveAll
pts.Add points(j)
pts.Add points(j - 1)
Set addftr = umapx.FeatureFactory.CreateLine(pts)
If i = 1 And j = 2 Then
currlayer.UpdateFeature ftr.FeatureKey, addftr
Else
currlayer.AddFeature addftr
End If
Next
Next
m1:
Next
currlayer.EndAccess miAccessEnd
' currlayer.Pack miPackAll
umapx.AutoRedraw = True
MsgBox Now()
End Sub
I'll be so gratefull if anyone helps.
Best Regards,
Katerinka
---------------------------------
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square