References: http://ka-map.ominiverdi.org/wiki/index.php
I. Environment preparation
Need to install Web Server (APACHE), PHP, Application Server (mapserv) and mapserv programming library API--PHP/mapscript, each part of the module can be compiled and installed by their own source code (if it is Linux/Unix ), you can also use the package for installation, such as ms4w in win And FGS in Linux (foss gis suite ).
- Apache (Web Server)
- Mapserver
- PHP
- Mapscript
Ii. Download ka-Map
Go to the Ka-map official website to download version 1.0, address: http://ka-map.maptools.org
The directory structure of Ka-map is as follows:
.../Kamap-1.0/
.../Kamap-1.0/docs/
.../Kamap-1.0/htdocs/
.../Kamap-1.0/htdocs/images/
.../Kamap-1.0/include/
Note: I copy the entire/Ka-MAP/directory to/apache2/htdocs.
Iii. Related Configuration
.../Ka-MAP/include/config. Dist. php is renamed as.../Ka-MAP/include/config. php
Configure the config. php file:
1,Setting up library pointers
Ka-map requires both PHP mapscript and the GD module for PHP. config. php needs to point to these library files (around line 23 ):
$ Szphpmapscriptmodule = 'php _ mapscript. '. php_shlib_suffix;
Or:
$ Szphpmapscriptmodule = 'php _ mapscript_46. '. php_shlib_suffix;
Note: The file name setting here must be the same as the file name of the library you configured and installed. In addition, do not add the suffix marker. (I only changed php_mapscript_46 to php_mapscript. The php_gd library file is not found)
2. add your own mapfile File
Modify the definition location of the variable $ aszmapfiles in the file:
$ Aszgmap = array (
'Title' => 'shape-test ',
'Path' => 'HTTP: // www.cnblogs.com/shape_label.map' ,//my mapfile
'Scales' => array (30000000,250, 150000)
'Format' => 'png'
);
$ Aszmapfiles = array ('gmap' => $ aszgmap );
Iv. Test
Enter http: // localhost/Ka-MAP/htdocs/in the browser to display the map normally, supports basic functions such as translation, multi-level Scaling, coordinate display, legend, scale, rubber zoom, and center positioning.