-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intersection callculation issue #34
Comments
have you tested it? |
yes, it works on my machine :) In the snippet there was missing brackets - (int)(mapWidth*scale) With orginal implementation on huge maps the tiles form the right and bottom - were not loaded at all. |
I see - you're not scaling the viewpot rect directly, you're just making sure the bounds are appropriate... Very cool. Although I'd think we'd still need <= for edges... I just committed a big update earlier today, but I'll verify this patch and apply it when I can (assuming there's no less-than-obvious gotchas). I'd be interested to see the very large maps you've mentioned (or at least the setup code), if you're not under NDA and are willing. Thanks for the feedback - I'll post back next week or sooner after testing. |
Basically setup look like this. Where map width/height is as big as 266842x90562. And for a tile size 512 it has up to 11 levels. I will try to prepare some video. |
wow - that must be an insane number of tiles - how big is the .apk? or maybe you're fetching them remotely? |
As I reported earlier - the integer is to small to store area :) |
very cool - did you just change |
Yes, it is enough to change implementation of decode method. Now I'm wondering about multithreading. Any tips? |
that method ( |
My idea was that i could download and decode few tiles at once to speed up loading process. As some tiles are already in cache I could load some from cache and in the same time download other from server. |
That could work - looks like AsyncTask went back to a single thread some time ago (Honeycomb). You'll probably need a complete rewrite of the TileManager, since that task's status (progress, suppression, cancellation, gc reference state, etc) is checked a lot to avoid manage what should and shouldn't be decoded and displayed (and managing memory generally). I'd be interested to hear how it works out, or even see it in action. |
I've just implemented the revised intersection math in my local build - not only does it "work", it prevents a great deal of unnecessary tile loads and noticeably increased performance - big thanks for this patch. I'm in the middle of a big update and probably won't commit for several days (or longer), but the next push will contain this update. |
I think that intersection is not calculated correctly. In zoomlevel.java
you are scaling tile size(tileWidth * scale) but using basemap size to calculate tile row/column.
Updated version of method below:
The text was updated successfully, but these errors were encountered: