Comments (12)
have you tested it?
from mapview.
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.
And after scaling map, on small zoom, request for tiles outside the map were sent, so I had to change "<=" to "<". Now i works fine.
from mapview.
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.
from mapview.
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.
for (int i = 0; i <= lvl; i++) {
mapView.addZoomLevel(mapWidth >> i, mapHeight >> i, pattern, Consts.TILE_SIZE, Consts.TILE_SIZE);
}
I will try to prepare some video.
from mapview.
wow - that must be an insane number of tiles - how big is the .apk? or maybe you're fetching them remotely?
from mapview.
As I reported earlier - the integer is to small to store area :)
Images(all levels) are up to 2GB. We are using image web server.
from mapview.
very cool - did you just change MapTile.decode
to grab the images over HTTP, or was there more required?
from mapview.
Yes, it is enough to change implementation of decode method. Now I'm wondering about multithreading. Any tips?
from mapview.
that method (MapTile.decode
) only ever runs in an AsyncTask
, which is backed by it's own thread pool, so you should be OK. AFAICT there's no substantial benefit to using a ExecutorService
or managing your own thread pool over AsyncTask
(although I know some people disagree).
from mapview.
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.
I.e. http://developer.android.com/reference/java/util/concurrent/BlockingQueue.html
from mapview.
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.
from mapview.
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.
from mapview.
Related Issues (20)
- Centering the map HOT 8
- Project Rename HOT 7
- Does MapView only draw PathViews that are visible? HOT 8
- Polygons as hotspots HOT 6
- Extra zoom feature HOT 8
- Increase the scrollable area in order to scroll the edges of the map into view HOT 4
- How to use HotSpot and HotSpotManager? HOT 3
- Render tiles outside of view HOT 2
- Loading downsample via TileDecoder HOT 2
- Markers moving when zooming HOT 2
- Callout drawn off screen HOT 3
- Image moving between zoom levels HOT 6
- Feature Requests HOT 15
- moveTo/slideTo rectangle HOT 4
- slideToAndCenter randomly not works HOT 3
- Adding ZoomLevels dynamically does not allow zooming. HOT 1
- How to listen onLongPress event? HOT 5
- map doesn't redraw after scrolling if scale is greater than 1 HOT 1
- Chaging zoomlevels dynamicaly doesn't show correct tiles HOT 1
- Gradle HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapview.