I have my Winforms map setup to use multithreading, but when panning the map the icon layer (just a static layer storing some points) flashes. Now, I imagine this is because it's drawing the base map and then drawing the icon layer, and since it's multithreaded the difference in drawing both is visible as a slight flash. So is there anyway I can tell the map to only display the updated images once all layers have been drawn?
Basically, can I get the map to draw the tiles to a single buffer and then display that buffer? That way I would have the benefits of multithreading (able to use the UI while updating the map) and also get rid of the annoying flashing issue. I tried doing it myself by overriding onPaint, onCurrentExtentChanged, onCurrentScaleChanged, etc., but it didn't work all that well because it would still flash while panning.
You can add them to different Overlay, when you want to re-draw the specific data, you can call winformsMap.Refresh(overlay) and pass in the specific overlay.
Thomas,
I look at the post you provided, the last reply is Yale’s, but we couldn’t contact with him any more, and I search our working tracking system and don’t find the item for this issue, I will create a new one for it.
They are already in a separate overlay. And it wasn't an issue updating the point layer, it was an issue with the point layer flashing when updating the base map layer (i.e. panning)
I ended up just giving each of my dynamic overlays an InMemoryBitmapTileCache object for its tile cache and clearing that whenever I make changes to the underlying data (i.e. add point, change point's displayed data, etc.). Probably not the best solution, and I had to be careful to clear the cache whenever even the slightest thing changes to make sure the change is visible, but atleast it works.
I am glad your workaround is working, so do you still want to a better solution for it? I don’t know if I can help you do it for right now, if you want to, could you provide a sample code that I can reproduce it to debug the problem.