How to improve drawing performance of a DotSpatial Map

475 Views Asked by At

I am writing sort of a navigation app, that needs to leave a trail of polygon. Creating the polygons and adding them to the map is not a problem, but then I have to update the map with the new polygon. The Standard way of doing this is by:

Map1.Refresh()

but doing the following also works, but they have the same effect, because they are lower level functions that are called by Refresh()

Map1.ResetBuffer()
Map1.MapFrame.Invalidate()

I am adding a new polygon about every second, this means that in 10 minutes I have 600 polygons. The Refresh procedure clears the whole buffer and recreates it going through every layer and every feature of every layer. When you have 1 layer and 600 features, this takes more than a second, so the program gets stuck. I realize that by now I also already found the solution, draw just the last feature, but:

  1. I don't know how
  2. Maybe there is some other solution to somehow refreshing the Map that is not so costly on the performance, ideally it should not depend on the total size of what needs to be displayed, but only on the size of the new objects that need to be drawn.

Any suggestions, C#, VB.NET, or plain old English, that might help me leave a trail of polygons on the map is welcomed.

0

There are 0 best solutions below