2010/02/18

Tile Mode

Introduction


MapServer can feed tile-based map clients directly using the CGI “tile mode”. Tile-based map clients work by dividing the map of the world up into a discrete number of zoom levels, each partitioned into a number of identically sized “tiles”. Instead of accessing a map by requesting a bounding box, a tile client builds a map by accessing individual tiles.

Tile requests are handled by the ‘mapserv’ CGI program. In order to return tiles in the correct projection, MapServer must be built with the –use-proj option turned on. You can check if your version of ‘mapserv’ has projection support by running it with the ‘-v’ option and looking for ‘SUPPORTS=PROJ’.

MapServer requires that each LAYER in your map file have a valid PROJECTION block to support reprojection. Because the tile mode uses reprojection, you will have to ensure each LAYER has a valid PROJECTION block.

Configuration checklist:
- MapServer compiled with PROJ support
- Map file with a PROJECTION defined for every LAYER

Utilization


The MapServer tile support adds three new directives to the CGI interface:
- mode=tile tells the server to generate tiles based on the other tile mode parameters
- tilemode=gmap tells the server use the Google Maps tile scheme for the tiles
- tile=x+y+z tells the server what tile you want to retrieve, using the Google Maps tile addressing system
- tilemode=ve tells the server use the Virtual Earth tile naming scheme for the tiles
- tile=10231 tells the server what tile you want to retrieve, using the Virtual Earth tile addressing system

No comments:

Post a Comment