| 1 | [[PageOutline]] |
| 2 | |
| 3 | This page is one of the !MapGuide Community CodeSamples. Visit the CodeSamples page to view more! |
| 4 | |
| 5 | == Seeding the Mapguide Tile Cache for a Tiled Map == |
| 6 | |
| 7 | The attached script uses OpenLayers to display a tiled map and provides the functionality to pan[[BR]] |
| 8 | and scan across the entire map, optionally for all scale levels. |
| 9 | |
| 10 | The logic is quite simple. Starting for the center of the map, it will pan left, then up and down to[[BR]] |
| 11 | calculate the number of rows and then right to calculate the number of columns. This could be simply[[BR]] |
| 12 | calculated but the tiles need to be requested anyway. |
| 13 | |
| 14 | Once that is known, the script will then either starting panning left to right down one and then [[BR]] |
| 15 | right to left and so on to request (and thus seed) the entire map. |
| 16 | |
| 17 | There is also an option to use a randomised request pattern. |
| 18 | |
| 19 | The attached file is configured to work with the sheboygan sample. |
| 20 | |
| 21 | == Future == |
| 22 | |
| 23 | The randomised logic could be improved generate the random list once rather than the approach currently used. |
| 24 | |
| 25 | Making the script into a fusion widget |
| 26 | |
| 27 | Some of a code cleanup :) |
| 28 | |
| 29 | |
| 30 | |