wiki:CodeSamples/Tiles/TileCacheSeeding

Version 2 (modified by gingerbbm, 16 years ago) ( diff )

Added note about ensuring that the bounds in the script match those in the MapDefinition.

This page is one of the MapGuide Community CodeSamples. Visit the CodeSamples page to view more!

Seeding the Mapguide Tile Cache for a Tiled Map

The attached script uses OpenLayers to display a tiled map and provides the functionality to pan
and scan across the entire map, optionally for all scale levels.

The logic is quite simple. Starting for the center of the map, it will pan left, then up and down to
calculate the number of rows and then right to calculate the number of columns. This could be simply
calculated but the tiles need to be requested anyway.

Once that is known, the script will then either starting panning left to right down one and then
right to left and so on to request (and thus seed) the entire map.

There is also an option to use a randomised request pattern.

The attached file is configured to work with the sheboygan sample.

Troubleshooting

  • Ensure that the bounds configured in the script reflect those configured in the MapDefinition.

Future

The randomised logic could be improved generate the random list once rather than the approach currently used.

Making the script into a fusion widget

Some of a code cleanup :)

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.