Getting MapScript

How do you get MapScript? There are variety of methods, some easier than others. The common requirement for running MapScript is that the scripting language itself must be available. The header files for the language may also be required if building the MapScript modules from source code.

Building MapScript from Source Code

Building MapScript from source for each language isn't detailed here, but there is a common approach.

To build MapScript for a language, support for that language must have been configured and built into MapServer itself when it was compiled. This sets up the various files in the MapScript language folders that are needed for the next step.

The MapServer source code directory structure includes a folder called mapscript. This folder has subsequent folders for each language that has some form of MapScript support. The folder may have a Makefile that is ready to be used by the make command, or it may have some setup scripts. Running these produces MapScript modules or libraries (depending on the language), and the scripts can often be used to help install them too. For example, with Python, you build and then install MapScript by running:

> python setup.py build
> python setup.py install

There are several other files and directories that are part of the Simplified Wrapper and Interface Generator (SWIG) environment. SWIG is used to port MapScript to certain languages. This is now the standard method for producing a MapScript extension for additional ...

Get Web Mapping Illustrated now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.