WPF Mapcontrol
Автор: larsyxa
Загружено: 2017-01-30
Просмотров: 2025
Описание:
WPF (Windows Presentation Foundation) Mapcontol uses OpenStreetView a cheap (free) Google maps clone. The issue i wanna highlight some issues. Its a Single Threaded control. Basicly what it means no other thread but the main thread (the one that created it) can alter. Other thread have to use a dispather. (Basicly a interface to the WPF:s message pump).
This demo draws indy lines between all major cities above 500000 population (some 10% filtered from around 8000 cities).
So the point bein after drawing some 850 lines i wanna zoom out and therefore i need to scale down the length. In this case i use a Parallel::For (.....new Action (scale line,)) (scale all lines..;) (Geoserver bein an native C++/CLI application you cant use native parallel_for.)
Btw its in the end of the clip. Its not fast, its suprisingly slow compare to a one process for-loop. So dont use multiple threads Dispatcher calls, you want gain anything. Kindof obvious if you think about it, 8 threads throwing shit at the same queue, tend too lead to crowding.
Nearing the end the update speed is dropping drastically, because I dont "world wrap" one leg is from Honolulu to Auckland is intentionally very long and I draw small tiny pieces of the line, hence they stack up, but once you reach the goal I redraw the hole line using LinearGradientBrush with some nifty Gradient stops to achive the rainbow effect, 1000 lines becomes one, no more stuttering.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: