[ka-Map-users] ka-Map-users Digest, Vol 58, Issue 2

TC Haddad tchaddad at gmail.com
Thu Mar 25 12:33:41 EST 2010

> ----------------------------------------------------------------------
> Date: Wed, 24 Mar 2010 23:04:13 -0700 (PDT)
> From: Deepa Thulasidasan <deepatulsidasan at yahoo.co.in>
> Subject: [ka-Map-users] Dynamic Map file
> Dear members,
> I am facing a problem as described below, hope some one can help.
> I have around 20 layers(shp format) in my data folder. I want to create 5 maps where 15 out of this 20 are always used and one additional layers is added to make it different. Again I create another  map using the same 15 layers and another layer to make it different from the one already created. Since this files are created with different names these are all stored in different folder under kcache directory. In this way it consumes lot of space to create different maps. I would like to know can I dynamically create a map depending on some input parameter so that I have only one map file.
> Regards,
> Deepa.

hi Deepa,

You can do a couple of things to save space:

- you can edit ka-map so that the cache files are shared between map
files and are never duplicated.
- you can use GROUP in your map file to make sure that your 15 base
layers are all drawn as a single cache layer.

To do the first you have to make an edit in your include/config.php :

- look for this line "/*****  END OF CONFIGURABLE STUFF - unless you
know what you are doing   *****/"
- somewhere just below it there is a line $szMapCacheDir =
- you must comment out the line above, and add two new lines. The
final should look like this:

/* $szMapCacheDir = $szBaseCacheDir.$szMap;    (old way stores cache
by mapfile then by scale then by group) */
$mySharedCache = 'shared';
$szMapCacheDir = $szBaseCacheDir.$mySharedCache;
/* this way stores cache by scale then by group (allows sharing
between mapfiles) */

To use GROUP in your mapfiles you can consult the normal Mapserver
documentation for LAYER here:

hope this helps,


More information about the ka-Map-users mailing list