After playing around with my own HTML/css templates for Mapserver, I started looking for a better solution. In fact, there are a number of frequently used frameworks (see http://maptools.org under Webtools).
I briefly looked at Dracones, because it’s written in Python. But I quickly got the sense that setup was less than straight forward. It sound like some of the adventures I had with getting any useful results out of (Geo)Django. Ka-Map appears to be pretty popular. But I didn’t like the look of their standard template, and wanted something to work out of the box.
So I turned to pmapper. It comes in a download-ready MS4W package that installs super easily – no problems at all if you’ve got a functioning version of MS4W version installed. I found it helpful to first get the sample project up and running – using the demodata provided. This works with a mapfile and some shapefiles of European countries and cities. Depending where you install (copy ‘n paste) your pmapper directory, you might have to adjust some of the Apache directives in httpd.conf. But if you’ve been through this for the MS4W installation, you won’t have any troubles.
Once you start using your own data, it might be easiest to work with the existing directory structure and slowly start changing/recycling the demodata mapfile. Anyway, now I have a great looking template with a somewhat dynamic legend, pan and continuous zoom, and more. The categories & groups references in config/config_default.xml confused me initially because groups actually refers to GROUP names in the MAPFILE. But with some trial and error, you get all your layers displayed the way you want.
There are still a few bugs, though, to be ironed out.
- The feature search still refuses to work properly.
- I think I may have made a mistake with my reference map, because the box highlighting my zoom area only adjusts in the north-south directions, but nevre east-west, and coincidentally, my panning now only works north-south but not east-west.
Since pmapper uses PHP and Javascript neither of which I understand well, the challenge now lies in adding some Python Mapscript capabilities so that I can extend the framework myself. I’m thinking about a little drop down input box where you select SHP data that’s added dynamically… I will get to that when I have time.