Offline Cache

Jan 21, 2009 at 10:22 AM
Further to my idea of extents. I am trying to write code that will take the current view, and taking the current min/max lat and min/max long points will
step the current point between each point for each further zoom in level. therefore causing all the tiles to be loaded and cached.

but i am not familiar with the math for the geo-coding to calculate the correct steps for long and lat to make sure each tile is covered
maybe taking the current control width, and determine the number of tilles in current view , to work out the lat step required ?
if you follow me ?

the psudo code is

from  current_zoom to 17
    from   min_lat     to    max_lat   step  lat_step
        from  min_long     to    max_long   step  long_step
            set current point

so for example, i can zoom to an area of the UK, then from there, cache each of the required titles for all zoom levels.
In particular, i have an app that is used in Ghana, west africa and internet connection is not always possible, so being able to
build a cache of a town there would be a major breakthrough for me.


Jan 21, 2009 at 10:41 AM
somethink like that, but google use tiles, so in precaching function code:  
  1. we shall use initial value of MainMap.CurrentViewArea
  2. calculate for current_zoom tile matrix, using FromLatLngToPixel -> FromPixelToTileXY with min/max lat/lng
  3. foreach(tile in matrix) { download & cache } - keep in mind google banns mass downloads from one ip, need change proxy from time to time
  4. current_zoom++ & repeat from 1 until zoom is <= max.
Jan 21, 2009 at 10:45 AM
Yes, thats exactly it.
But my knowlege of working with GEO coding is not good.
i would really apreciate any help you could give me with this when you have time,