|
From: ztep <juj...@ya...> - 2006-11-01 19:14:20
|
>> My next work is to transfer my previous work done over v0.9.2.3.3 to this >> version. Before, I want to tell you some of the chages I have >> incorporated >> in order to get your opinions/approval: >> 1 - Add MapSelector class as said on todo.txt: no comments (although I >> haven used QPixmapCache as explained later). > The idea of the QPixmapCache was based on the later possibility to use > the code for vector maps (drawing this maps takes some time, so there was > the idea of caching). Caching makes sense for tiles as well, but it can be > done a lot of different ways (e.g. manually select which tiles have to be > loaded from disc and which are kept inside the memory...). It's just > important that it is not necessary to load all tiles into the memory... Yes, I will plan to load only the maps involved in drawing the current map, that is the current position and an area around it. >> 2 - Improve map detection: Now to search which maps to include on >> actMapList it calls calcxy(...), that is a quite complex function, so it >> only search a few maps each iteration. I have improved this search adding >> as members of each map (on MapBase) the limits of the map (nort, south, >> west and east). This limits are calculated on the map constructor and >> checked on a funciton isInside(latitude, longitude) that is used in the >> map >> search and also to draw traks and places. Using this operation searching >> on >> a list of about 1000 maps it only takes 2-3 ms. > Calcxy was needed, if several maps are partially inside the display. > How do you handle this situation now ? (do you check which map has the > best > coverage if 2 maps are "inside" but do not cover the whole display; ok, > this > is less important if tiled maps are available). I use isInside position tu test if the current position is inside the map and then the map is loaded and added to actMapList. Then the map to show is selected just as before, using calcxy and coverge funcions. But this time you only have to iterate in actMapList that usually has only a few maps. Anyway when I implement tiled maps the main list of maps will be a lot sort and this problem will be less important, as you said. >> The idea is: you call MapDisp::createMap 4 times on a second, but you >> detect a map afer several seconds (or minutes depending on your speed and >> the maps zoom and dimensions), so I have tried to aligerate >> MapDisp::createMap at the cost of more memory usage and more time to load >> a >> map when it is detected to be on the cover area. > Another idea was to calculate the distance between the current position > and > the maps and then sort the maps by this distance: the closer a map is, the > more frequently it is checked. But if you found a fast and working way to > do > it, the better it is. The problem is that you must update the distance from the current position and then re-sort the map. I think that this can be as slow (or more) than the current implementation. > Please be careful about memory usage, because some PDAs have only 32M. > Which device are you using (Zaurus, Ipaq,...) ? I use a Zaurus C3200, but I also has tested it on a C760, both with cacko rom. ______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com |