#! /usr/bin/python
# Copyright (C) 2000, 2001 Intevation GmbH <intevation@intevation.de>
# Author: Bernhard Herzog <bh@intevation.de>
#
# This program is free software under the LGPL (>=v2)
# Read the file COPYING coming with MapIt! for details.

__version__ = "$Revision: 1.8 $"

import os, sys

import cgi

sys.path.insert(0, '../base')

import pagetemplate, tileinfo, markerinfo, common, mapconfig

def main():
    print 'Content-type: text/html'
    print
    template = pagetemplate.TemplateProcessor(mapconfig.template_file)
    map = tileinfo.MapInfo(mapconfig.tile_dir, mapconfig.tile_ext)
    marker = markerinfo.MarkerInfo(mapconfig.marker_locations,
                                   mapconfig.marker_dir,
                                   mapconfig.marker_ext)
    parameters = common.Parameters(cgi.FieldStorage(), showmap = "showmap",
                                   map = map, marker = marker)
    template.generate_html(parameters, sys.stdout)

main()
