Version 2 (modified by 16 years ago) ( diff ) | ,
---|
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)
-
mapguide_tile_seeder.html
(13.5 KB
) - added by 16 years ago.
first cut of a mapguide tile seeder
- mg-openlayers.js (145.4 KB ) - added by 15 years ago.
Download all attachments as: .zip