jozefchutka / YCanvas

YCanvas is an open source 2D tile renderer library written in ActionScript 3. It provides high performance solution for rendering world maps. The library also contains Stage3D (GPU) accelerated implementation based on Starling.
http://blog.yoz.sk/2012/01/introduction-to-ycanvas/
MIT License
117 stars 28 forks source link

Calculate required tiles #7

Closed bknill closed 8 years ago

bknill commented 8 years ago

Hi,

I'm using your stunning library and while it was hard work to get started, it's well worth the effort!

I'd like to pre-load and cache tiles (I'm using mapbox) to try and get the maps to renderer faster.

Is there anything in your code that could give me a list of all the URLS for required tiles based on limits so I could start downloading them while the user is doing something else?

jozefchutka commented 8 years ago

hi bknill, basicaly the implementation for generating image url from x/y/z for each particular tile/partition is inside the Partition class ( this one is for bing https://github.com/jozefchutka/YCanvas/blob/master/ApplicationMap/src/main/actionscript/sk/yoz/ycanvas/map/demo/partition/CustomPartition.as ). You can move the algorithm anywhere so then you can modify it to produce urls by custom params. There is also an option to increase value here https://github.com/jozefchutka/YCanvas/blob/master/YCanvasLibrary/src/main/actionscript/sk/yoz/ycanvas/AbstractYCanvas.as#L46 so even the invisible tiles around your current viewport would get preloaded

bknill commented 8 years ago

Awesome thanks