I am drawing up to 500 lines at a maximum rate of 20 lines per second. I found that the map display is getting slower when the updates is that fast.
Any suggestions on how to solve this performance issue ?
Attaced is my code.
Public Sub Draw_Line(ByVal Ref, ByVal LongBeg, ByVal LatBeg, ByVal LongEnd, ByVal LatEnd, ByVal Layer, ByVal Label, ByVal Colour, ByVal LineType, ByVal Linewidth)
Dim sysColour As System.Drawing.Color = System.Drawing.ColorTranslator.FromOle(Colour)
Dim geoColour As GeoColor = GeoColor.FromArgb(sysColour.A, sysColour.R, sysColour.G, sysColour.B)
Dim valueStyle As New ValueStyle()
valueStyle.ColumnName = "Line"
Dim valueItem As New ValueItem()
valueItem.DefaultAreaStyle.OutlinePen.Color = geoColour
valueItem.DefaultLineStyle.OuterPen.Color = geoColour
valueItem.DefaultLineStyle.OuterPen.Width = Linewidth
valueItem.Value = CStr(Ref)
valueStyle.ValueItems.Add(valueItem)
Dim inMemoryLayer As InMemoryFeatureLayer = CType(WinformsMap1.FindFeatureLayer(Get_Layer(Layer)), InMemoryFeatureLayer)
inMemoryLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle)
inMemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
inMemoryLayer.Open()
inMemoryLayer.Columns.Add(New FeatureSourceColumn("Line"))
inMemoryLayer.Close()
Dim lineShape As New LineShape()
lineShape.Vertices.Add(New Vertex(LongBeg, LatBeg))
lineShape.Vertices.Add(New Vertex(LongEnd, LatEnd))
lineShape.Id = CStr(Ref)
Dim newFeature As Feature = New Feature(lineShape)
newFeature.ColumnValues.Add("Line", CStr(Ref))
inMemoryLayer.InternalFeatures.Add(newFeature)
WinformsMap1.Refresh(WinformsMap1.Overlays())
End Sub