MapFish installation

MapFish is composed of two parts: MapFish Client and MapFish Server.

MapFish Client is a JavaScript library based on OpenLayers and Ext.

MapFish Server is itself composed of two parts: MapFish Server Framework and MapFish Server Libraries.

MapFish Server Framework provides a Python development framework based on the Pylons web development framework.

MapFish Server Libraries provides Python, Java, and PHP libraries to be used by application programmers as helpers to implement MapFish web services.

Download

You can either download the current stable version or get the development version from the SVN repository.

MapFish Client

To install MapFish Client you just need to have the client/ directory of the MapFish source tree in a web directory.

For example, on the Debian-based system with Apache, the default web directory is /var/www/wwwroot.

Then, you should be able to point your browser to the client/examples directory and play with the provided examples.

Note that some examples (e.g. search) rely on web services. They are configured to use web services provided on Camptocamp servers. For those to work, you'll need to copy the proxy.cgi script (located under client/examples/ to your web server's CGI directory (/usr/lib/cgi-bin/ for Apache on Debian-based systems).

See the examples to understand how to make use of MapFish in your web pages. Also, refer to How ToUse Widgets.

Also, refer to How ToBuild to know how to build a compressed MapFish library.

MapFish Server Framework

To be able to create MapFish projects based on MapFish Server Framework you must install that framework.

Windows users: follow the instructions on How ToInstall Windows (contributed by Yves Moisan and Fabio D'Ovidio).

Python Environment

The framework is a Python package, a.k.a Python egg. You can install the MapFish egg either in your system-wide Python environment or in a virtual Python environment. The following steps assume that you install it in a virtual environment. Just adapt the instructions if you do it otherwise.

Install gcc, libc6-dev, libpq-dev, python, python-dev and libgeos-dev packages. For debian:

apt-get install gcc libc6-dev libpq-dev python python-dev libgeos-dev

Install setuptools if not already installed:

cd /tmp
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

Install virtualenv:

easy_install virtualenv

Now you can create your virtual python environment (with your regular login):

cd /path/to/somewhere/
virtualenv vpython

MapFish egg

Note: if you want to build the MapFish egg yourself from the MapFish source, look at this HowTo.

To install the MapFish Server Framework egg and its dependencies use this command:

/path/to/somewhere/vpython/bin/easy_install -i http://dev.camptocamp.com/packages/mapfish/1.0/index mapfish==1.0

You now have MapFish Server Framework installed.

ctypes

If you use Python 2.5, you can just ignore that section as ctypes is included in the Python 2.5 distribution. If you use Python 2.4 you need to install ctypes.

If the installation of the MapFish package didn't install ctypes, first try installing it with:

/path/to/somewhere/vpython/bin/easy_install -i http://dev.camptocamp.com/packages/mapfish/1.0/index ctypes

If it doesn't work (there are cases where it doesn't!) then install the ctypes package provided with your operating system, on Debian-type systems:

apt-get install python-ctypes

You should be all set to go ahead and create MapFish projects. See How ToUse Map Fish Server to learn about the steps to create MapFish projects. You can also look at How ToInstall Map Fish Sample to know how to install the sample MapFish project.

MapFish Server Library

At this time, MapFish Server Library includes:

  1. Python modules, which provide
  2. Java library for reading and writing GeoJSON, namely mapfish-geo-lib
  3. Java library for generating pdf

Python modules

The Python modules are provided in the MapFish Python package (see above).

GeoJSON Java lib

To build mapfish-geo-lib, follow these steps:

/path/to/apache-maven-2.0.8/bin/mvn package

This should create the jar file mapfish-geo-lib-0.1.jar.

Print Java lib

See Print Module Doc.