Previous topic

Setting up a MapFish application

Next topic

Creating MapFish Web Services

This Page

Installing the JavaScript toolboxΒΆ

MapFish provides another application template for installing the MapFish JavaScript toolbox in the application, this template is named mapfish_client.

Note

You can use paster create --list-templates to get a list of all available application templates.

To install the JavaScript toolbox in the HelloWorld application execute the following command in the directory including the HelloWorld directory:

(venv) $ paster create -t mapfish_client HelloWorld

You can safely answer y when you asked whether the favicon.ico and index.html files can be overwritten. It means those two files will be replaced by those in the mapfish_client template, which is what we want.

You can now visit http://localhost:5000 again. You should get an example page, with an OpenStreetMap map.

Let’s now look at what the paster create -t mapfish_client command does. In addition to replacing the favicon.ico and index.html file the command creates three new directories in the application’s public directory.

lib
This directory contains the JavaScript toolbox. It includes sub-directories for the Ext, OpenLayers, GeoExt, and MapFish Client toolkits.
app
This directory contains static files specific to the application. It includes a js directory, into which you can put the JavaScript code specific to the application. The mapfish_client template installs a default JavaScript application, which is implemented in the helloworld_init.js and helloworld_layout.js files. You can add other directories like css and img in this app directory.
tests
This directory includes the Test.AnotherWay JavaScript testing framework, with a test example in app/TheObvious.html. MapFish encourages JavaScript developpers to write tests.

To learn how to use the JavaScript libraries composing the toolbox consult the following documentations:

Look also at the various API docs.